https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91193
Bug ID: 91193 Summary: [8 regression] ICE on invalid: tree check: expected class ‘type’, have ‘declaration’ (function_decl) in grokdeclarator, at c/c-decl.c:5956 Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: dimhen at gmail dot com Target Milestone: --- r257061 FAIL r273505 FAIL $ cat x.i typedef a; void a() a b; $ /usr/local/gcc_current/bin/gcc -fpreprocessed x.i x.i:1:9: warning: type defaults to ‘int’ in declaration of ‘a’ [-Wimplicit-int] 1 | typedef a; | ^ x.i:2:6: error: ‘a’ redeclared as different kind of symbol 2 | void a() a b; | ^ x.i:1:9: note: previous declaration of ‘a’ was here 1 | typedef a; | ^ x.i: In function ‘a’: x.i:2:1: internal compiler error: tree check: expected class ‘type’, have ‘declaration’ (function_decl) in grokdeclarator, at c/c-decl.c:5956 2 | void a() a b; | ^~~~ 0x7a948e tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) /home/dimhen/src/gcc_current/gcc/tree.c:9953 0x5db72d tree_class_check(tree_node*, tree_code_class, char const*, int, char const*) /home/dimhen/src/gcc_current/gcc/tree.h:3340 0x5db72d grokdeclarator /home/dimhen/src/gcc_current/gcc/c/c-decl.c:5956 0xa39e3b start_decl(c_declarator*, c_declspecs*, bool, tree_node*) /home/dimhen/src/gcc_current/gcc/c/c-decl.c:4872 0xa8e114 c_parser_declaration_or_fndef /home/dimhen/src/gcc_current/gcc/c/c-parser.c:2159 0xa8f16a c_parser_declaration_or_fndef /home/dimhen/src/gcc_current/gcc/c/c-parser.c:2321 0xa963cf c_parser_external_declaration /home/dimhen/src/gcc_current/gcc/c/c-parser.c:1658 0xa96e19 c_parser_translation_unit /home/dimhen/src/gcc_current/gcc/c/c-parser.c:1539 0xa96e19 c_parse_file() /home/dimhen/src/gcc_current/gcc/c/c-parser.c:20010 0xaecfcb c_common_parse_file() /home/dimhen/src/gcc_current/gcc/c-family/c-opts.c:1160 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. $ /usr/local/gcc_current/bin/gcc -v Using built-in specs. COLLECT_GCC=/usr/local/gcc_current/bin/gcc COLLECT_LTO_WRAPPER=/usr/local/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/10.0.0/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none Target: x86_64-pc-linux-gnu Configured with: /home/dimhen/src/gcc_current/configure --prefix=/usr/local/gcc_current --enable-checking=yes,df,fold,rtl,extra --enable-languages=c,c++,lto --disable-multilib --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --with-tune=native Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 10.0.0 20190716 (experimental) [trunk revision 273505] (GCC)