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

--- Comment #5 from Vegard Nossum <vegard.nossum at gmail dot com> ---
I have another testcase which crashes in a similar way, but I'm not sure if
it's the same underlying bug or not:

void a() {
  enum * {
    [] (union {})
  };
}

The original crash was:

(gdb) run
Starting program: xgcc -x c++ -std=c++14 -O3 -Wall -fpermissive -c input-1.cc
[New process 19395]
process 19395 is executing new program: cc1plus
input-1.cc:1:3: warning: ISO C++ forbids declaration of 'a' with no type
[-fpermissive]
 a(){[](class{
   ^
input-1.cc: In function 'int a()':
input-1.cc:1:13: error: types may not be defined in parameter types
 a(){[](class{
             ^
input-1.cc:1:13: error: expected '}' at end of input
input-1.cc:1:13: error: expected ',' or '...' at end of input
input-1.cc:1:14: error: expected ')' at end of input
 a(){[](class{
       ~     ~^
              )

Thread 2.1 "cc1plus" received signal SIGSEGV, Segmentation fault.
[Switching to process 19395]
0x000000000167a1f4 in ggc_internal_alloc (size=48, f=0x0, s=0, n=1) at
/home/vegard/git/gcc/gcc/ggc-page.c:1274
1274      entry = G.pages[order];
(gdb) bt
#0  0x000000000167a1f4 in ggc_internal_alloc (size=48, f=0x0, s=0, n=1) at
/home/vegard/git/gcc/gcc/ggc-page.c:1274
#1  0x0000000000000000 in ?? ()

The new one is:

(gdb) run
Starting program: xgcc -x c++ -std=c++14 -O3 -Wall -fpermissive -c input.cc
[New process 14133]
process 14133 is executing new program: cc1plus
input.cc: In function 'void a()':
input.cc:3:15: error: types may not be defined in parameter types
     [] (union {})
               ^

Thread 2.1 "cc1plus" received signal SIGSEGV, Segmentation fault.
[Switching to process 14133]
0x00000000010529cd in dguide_name_p (name=0x7ffff6d5c000) at
/home/vegard/git/gcc/gcc/cp/pt.c:25423
25423   {
(gdb) bt
#0  0x00000000010529cd in dguide_name_p (name=0x7ffff6d5c000) at
/home/vegard/git/gcc/gcc/cp/pt.c:25423
#1  0x0000000000000000 in ?? ()

It crashes in a different place but they both have the "types may not be
defined in parameter types" error and I'm not sure why gdb is not able to
follow the stack properly.

Reply via email to