https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96364
Bug ID: 96364
Summary: ICE on valid code in cp_finish_decl, at cp/decl.c:7537
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: haoxintu at gmail dot com
Target Milestone: ---
Hi, all.
Weirdly, this simple valid code makes GCC ICE (clang,icc,or msvc accepts this
code).
Input:
//small.cc
auto a[[]] [[]]();
Command:
g++ small.cc
Output:
small.cc:1:17: internal compiler error: in cp_finish_decl, at cp/decl.c:7536
1 | auto a[[]] [[]]();
| ^
0x63f6dc cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/cp/decl.c:7536
0x9ed9b9 cp_parser_init_declarator
../../gcc/cp/parser.c:20990
0x9cdacc cp_parser_simple_declaration
../../gcc/cp/parser.c:13799
0x9f8d2e cp_parser_declaration
../../gcc/cp/parser.c:13498
0x9f941b cp_parser_translation_unit
../../gcc/cp/parser.c:4781
0x9f941b c_parse_file()
../../gcc/cp/parser.c:44069
0xb13e2d c_common_parse_file()
../../gcc/c-family/c-opts.c:1188
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
I have tested this in GCC-7.1 onwards versions, and they all behave the same.
Thanks,
Haoxin