https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86546
Bug ID: 86546 Summary: ICE on invalid: tree_class_check_failed() Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: dimhen at gmail dot com Target Milestone: --- r255090 FAIL r262747 FAIL $ cat x.ii class a b; c() { switch () case b $ /usr/local/gcc_current/bin/g++ -fpreprocessed -std=c++98 x.ii x.ii:1:9: error: aggregate ‘a b’ has incomplete type and cannot be defined class a b; ^ x.ii:2:3: error: ISO C++ forbids declaration of ‘c’ with no type [-fpermissive] c() { ^ x.ii: In function ‘int c()’: x.ii:3:11: error: expected primary-expression before ‘)’ token switch () ^ x.ii:4:8: internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in cxx_eval_constant_expression, at cp/constexpr.c:4170 case b ^ 0x7cfc19 tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) /home/dimhen/src/gcc_current/gcc/tree.c:9401 0x5f561f tree_class_check(tree_node*, tree_code_class, char const*, int, char const*) /home/dimhen/src/gcc_current/gcc/tree.h:3240 0x5f561f cxx_eval_constant_expression /home/dimhen/src/gcc_current/gcc/cp/constexpr.c:4170 0x9603dd cxx_eval_outermost_constant_expr /home/dimhen/src/gcc_current/gcc/cp/constexpr.c:4931 0x986ea5 finish_case_label(unsigned int, tree_node*, tree_node*) /home/dimhen/src/gcc_current/gcc/cp/decl.c:3602 0xa1e3c0 cp_parser_label_for_labeled_statement /home/dimhen/src/gcc_current/gcc/cp/parser.c:11062 0xa234a4 cp_parser_statement /home/dimhen/src/gcc_current/gcc/cp/parser.c:10896 0xa452b7 cp_parser_implicitly_scoped_statement /home/dimhen/src/gcc_current/gcc/cp/parser.c:12661 0xa23aab cp_parser_selection_statement /home/dimhen/src/gcc_current/gcc/cp/parser.c:11583 0xa23aab cp_parser_statement /home/dimhen/src/gcc_current/gcc/cp/parser.c:10834 0xa24a08 cp_parser_statement_seq_opt /home/dimhen/src/gcc_current/gcc/cp/parser.c:11292 0xa24ae7 cp_parser_compound_statement /home/dimhen/src/gcc_current/gcc/cp/parser.c:11246 0xa3ad80 cp_parser_function_body /home/dimhen/src/gcc_current/gcc/cp/parser.c:21921 0xa3ad80 cp_parser_ctor_initializer_opt_and_function_body /home/dimhen/src/gcc_current/gcc/cp/parser.c:21958 0xa3b5f0 cp_parser_function_definition_after_declarator /home/dimhen/src/gcc_current/gcc/cp/parser.c:26974 0xa3c315 cp_parser_function_definition_from_specifiers_and_declarator /home/dimhen/src/gcc_current/gcc/cp/parser.c:26890 0xa3c315 cp_parser_init_declarator /home/dimhen/src/gcc_current/gcc/cp/parser.c:19646 0xa4317a cp_parser_simple_declaration /home/dimhen/src/gcc_current/gcc/cp/parser.c:13180 0xa481d2 cp_parser_declaration /home/dimhen/src/gcc_current/gcc/cp/parser.c:12903 0xa485cd cp_parser_declaration_seq_opt /home/dimhen/src/gcc_current/gcc/cp/parser.c:12779 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/g++ -v Using built-in specs. COLLECT_GCC=/usr/local/gcc_current/bin/g++ COLLECT_LTO_WRAPPER=/usr/local/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/9.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 --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --with-tune=native Thread model: posix gcc version 9.0.0 20180716 (experimental) [trunk revision 262747] (GCC)