https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124498
Bug ID: 124498
Summary: ICE: segmentation fault on invalid template
declaration
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: suyuchang at whu dot edu.cn
Target Milestone: ---
Code:
template <template()->struct a()->auto
Command:
g++ test.cpp
Output:
test.cpp:1:39: internal compiler error: Segmentation fault
0x2cb8d8e internal_error(char const*, ...)
../../gcc-trunk/gcc/diagnostic-global-context.cc:787
0x16f2b26 crash_signal
../../gcc-trunk/gcc/toplev.cc:325
0x7f678374d51f ???
./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0xe05893 abort_fully_implicit_template
../../gcc-trunk/gcc/cp/parser.cc:57734
0xe05ad7 cp_parser_skip_to_end_of_block_or_statement
../../gcc-trunk/gcc/cp/parser.cc:4436
0xe6f679 cp_parser_single_declaration
../../gcc-trunk/gcc/cp/parser.cc:36535
0xe6fa6b cp_parser_template_declaration_after_parameters
../../gcc-trunk/gcc/cp/parser.cc:36157
0xe6fa6b cp_parser_explicit_template_declaration
../../gcc-trunk/gcc/cp/parser.cc:36331
0xe80571 cp_parser_declaration
../../gcc-trunk/gcc/cp/parser.cc:17595
0xe83628 cp_parser_toplevel_declaration
../../gcc-trunk/gcc/cp/parser.cc:17705
0xe83628 cp_parser_translation_unit
../../gcc-trunk/gcc/cp/parser.cc:5596
0xe83628 c_parse_file()
../../gcc-trunk/gcc/cp/parser.cc:57467
0x1025990 c_common_parse_file()
../../gcc-trunk/gcc/c-family/c-opts.cc:1422
/home/syc/gcc-16.0/libexec/gcc/x86_64-pc-linux-gnu/16.0.1/cc1plus -quiet
-imultiarch x86_64-linux-gnu -D_GNU_SOURCE test.cpp -quiet -dumpdir a-
-dumpbase test.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -o
/tmp/cchogAA0.s
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
Regression since GCC 14.3
The test case was generated by a fuzzer.