public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ppalka at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/114889] New: [modules] ICE in friend_accessible_p with imported class template specialization befriending class template
Date: Mon, 29 Apr 2024 13:15:53 +0000	[thread overview]
Message-ID: <bug-114889-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114889

            Bug ID: 114889
           Summary: [modules] ICE in friend_accessible_p with imported
                    class template specialization befriending class
                    template
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppalka at gcc dot gnu.org
  Target Milestone: ---

$ cat testcase_a.C
export module mymod;

template <typename, typename>
struct _Hashtable;

export
template <typename _Key, typename _Val>
struct _Map_base {
  void f() {
    _Hashtable<_Key, _Val> __h;
    __h._M_hash_code(0);
  }
};

template <typename _Key, typename _Value>
struct _Hashtable {
  template <typename, typename> friend struct _Map_base;
protected:
  void _M_hash_code(int);
};

_Hashtable<int, int> m;

$ cat testcase_b.C
import mymod;

int main() {
  _Map_base<int, int> m;
  m.f();
}

$ g++ -fmodules-ts testcase_*
In module mymod, imported at testcase_b.C:1:
testcase_a.C: In instantiation of ‘void _Map_base@mymod<_Key, _Val>::f() [with
_Key = int; _Val = int]’:
testcase_b.C:5:6:   required from here
    5 |   m.f();
      |   ~~~^~
testcase_a.C:11:21: internal compiler error: in friend_accessible_p, at
cp/search.cc:803
   11 |     __h._M_hash_code(0);
      |     ~~~~~~~~~~~~~~~~^~~

             reply	other threads:[~2024-04-29 13:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29 13:15 ppalka at gcc dot gnu.org [this message]
2024-04-29 13:17 ` [Bug c++/114889] " ppalka at gcc dot gnu.org
2024-04-30  1:28 ` cvs-commit at gcc dot gnu.org
2024-04-30  1:29 ` ppalka at gcc dot gnu.org
2024-05-07 14:49 ` cvs-commit at gcc dot gnu.org
2024-05-07 14:49 ` ppalka at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-114889-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).