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

            Bug ID: 94027
           Summary: ice in comptypes, at cp/typeck.c:1489
           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: ---

This C++ code

class a {
public:
  a(char);
};
struct b {
  b(a);
};
template <typename... aw, int...> void ax(int) {
  struct c : b {
    c() : b{sizeof...(aw)} {}
  };
}
void az() { ax({}); }

with recent gcc trunk:

/home/dcb/gcc/results.20200224/bin/gcc
/home/dcb/gcc/results.20200225/bin/gcc
/home/dcb/gcc/results.20200227/bin/gcc
/home/dcb/gcc/results.20200228/bin/gcc
bug586.cc: In instantiation of ‘ax(int)::c::c() [with aw = {}; int
...<anonymous
> = {}]’:
bug586.cc:10:29:   required from ‘ax(int)::c::c() [with aw = {}; int
...<anonymo
us> = {}]’
bug586.cc:11:3:   required from ‘void ax(int) [with aw = {}; int ...<anonymous> 
= {}]’
bug586.cc:13:18:   required from here
bug586.cc:10:5: internal compiler error: in comptypes, at cp/typeck.c:1489
   10 |     c() : b{sizeof...(aw)} {}
      |     ^
0x6af450 comptypes(tree_node*, tree_node*, int)
        ../../trunk.git/gcc/cp/typeck.c:1489
0xa18cf4 find_substitution
        ../../trunk.git/gcc/cp/mangle.c:656
0xa1aaf2 write_prefix
        ../../trunk.git/gcc/cp/mangle.c:1122
0xa1adfa write_nested_name
        ../../trunk.git/gcc/cp/mangle.c:1090

So it looks to be broken sometime from 27 Feb to 28 Feb.
Original unreduced C++ code available on request.

Reply via email to