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

            Bug ID: 92339
           Summary: ice at cp/typeck.c:1510
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

For this C++ source code:

class a {
  template <typename b, b a::*> struct c { c(a *); };
  int m_fn1();
  unsigned long d;
  using e = c<unsigned long, &a::d>;
};
int a::m_fn1() { e(this); }

compiled with recent gcc trunk, does this:

bug557.cc: In instantiation of ‘struct a::c<long unsigned int, &a::d>’:
bug557.cc:7:24:   required from here
bug557.cc:2:44: internal compiler error: canonical types differ for identical
types ‘a::c<long unsigned int, &a::d>’ and ‘a::c<long unsigned int, &a::d>’
    2 |   template <typename b, b a::*> struct c { c(a *); };
      |                                            ^
0xad8236 comptypes(tree_node*, tree_node*, int)
        ../../trunk/gcc/cp/typeck.c:1510
0x9ce571 push_scope(tree_node*)
        ../../trunk/gcc/cp/name-lookup.c:4063
0x9c01d5 synthesized_method_walk
        ../../trunk/gcc/cp/method.c:1652
0x9c1f16 implicitly_declare_fn(special_function_kind, tree_node*, bool,
tree_node*, tree_node*)
        ../../trunk/gcc/cp/method.c:2046

The problem seems to start sometime between revision 277600 and
277650.

Reply via email to