https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84733
Bug ID: 84733 Summary: internal compiler error: Segmentation fault (check_local_shadow()) Product: gcc Version: 8.0.1 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vegard.nossum at gmail dot com CC: webrown.cpp at gmail dot com Target Milestone: --- Input: struct c { ~c(); } b; void f() { try { d: ; } catch (int) { } decltype(b) a; int e; struct e f; } Output: $ xgcc -x c++ -S - <stdin>:14:10: internal compiler error: Segmentation fault 0x3152ce9 crash_signal /home/vegard/git/gcc/gcc/toplev.c:325 0xe47760 check_local_shadow /home/vegard/git/gcc/gcc/cp/name-lookup.c:2683 0xe5b1b7 do_pushdecl /home/vegard/git/gcc/gcc/cp/name-lookup.c:3086 0xe6030f pushdecl(tree_node*, bool) /home/vegard/git/gcc/gcc/cp/name-lookup.c:3154 0xe6030f do_pushdecl_with_scope /home/vegard/git/gcc/gcc/cp/name-lookup.c:3982 0xe62f98 do_pushtag /home/vegard/git/gcc/gcc/cp/name-lookup.c:6444 0xe62f98 pushtag(tree_node*, tree_node*, tag_scope) /home/vegard/git/gcc/gcc/cp/name-lookup.c:6514 0xb5f965 xref_tag_1 /home/vegard/git/gcc/gcc/cp/decl.c:13726 0xb5f965 xref_tag(tag_types, tree_node*, tag_scope, bool) /home/vegard/git/gcc/gcc/cp/decl.c:13783 0xf8396d cp_parser_elaborated_type_specifier /home/vegard/git/gcc/gcc/cp/parser.c:17918 0xf2265c cp_parser_type_specifier /home/vegard/git/gcc/gcc/cp/parser.c:16802 0xf8858a cp_parser_decl_specifier_seq /home/vegard/git/gcc/gcc/cp/parser.c:13629 0xfa3a70 cp_parser_simple_declaration /home/vegard/git/gcc/gcc/cp/parser.c:12938 0xfab998 cp_parser_block_declaration /home/vegard/git/gcc/gcc/cp/parser.c:12883 0xfade64 cp_parser_declaration_statement /home/vegard/git/gcc/gcc/cp/parser.c:12476 0xefab2b cp_parser_statement /home/vegard/git/gcc/gcc/cp/parser.c:10925 0xefe5eb cp_parser_statement_seq_opt /home/vegard/git/gcc/gcc/cp/parser.c:11274 0xeff08a cp_parser_compound_statement /home/vegard/git/gcc/gcc/cp/parser.c:11228 0xf9283b cp_parser_function_body /home/vegard/git/gcc/gcc/cp/parser.c:21778 0xf9283b cp_parser_ctor_initializer_opt_and_function_body /home/vegard/git/gcc/gcc/cp/parser.c:21813 $ xgcc --version xgcc (GCC) 8.0.1 20180306 (experimental) Built from git 11a93d7a09b871b3b9a2eb108eb91ad83d94e070 (r258271). 5.5.0 says: <source>: In function 'void f()': <source>:12:13: error: 'decltype' was not declared in this scope decltype(b) a; ^ <source>:14:12: error: aggregate 'f()::e f' has incomplete type and cannot be defined struct e f; ^ Compiler returned: 1 Test case was minimised by C-Reduce.