http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58563
Bug ID: 58563 Summary: [c++0x] ICE calling invalid destructor Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org The following code snippet (compiled with "-std=c++0x") triggers an ICE since GCC 4.4.0: ============================== template<int> void foo() { enum E {}; E().E::~T(); } ============================== bug.cc: In function 'void foo()': bug.cc:4:11: error: 'enum foo()::E' is not a class E().E::~T(); ^ bug.cc:4:11: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in cp_parser_lookup_name, at cp/parser.c:21759 0xcda4a9 tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) ../../gcc/gcc/tree.c:9227 0x6322f5 tree_class_check ../../gcc/gcc/tree.h:2732 0x6322f5 cp_parser_lookup_name ../../gcc/gcc/cp/parser.c:21759 0x64f3a0 cp_parser_class_name ../../gcc/gcc/cp/parser.c:18736 0x64abb4 cp_parser_unqualified_id ../../gcc/gcc/cp/parser.c:4883 0x64b3f3 cp_parser_id_expression ../../gcc/gcc/cp/parser.c:4647 0x65b8de cp_parser_postfix_dot_deref_expression ../../gcc/gcc/cp/parser.c:6368 0x643569 cp_parser_postfix_expression ../../gcc/gcc/cp/parser.c:6031 0x64615d cp_parser_unary_expression ../../gcc/gcc/cp/parser.c:7009 0x646d3f cp_parser_binary_expression ../../gcc/gcc/cp/parser.c:7701 0x6471ff cp_parser_assignment_expression ../../gcc/gcc/cp/parser.c:7937 0x649063 cp_parser_expression ../../gcc/gcc/cp/parser.c:8099 0x64985e cp_parser_expression ../../gcc/gcc/cp/parser.c:8138 0x64985e cp_parser_expression_statement ../../gcc/gcc/cp/parser.c:9429 0x63f187 cp_parser_statement ../../gcc/gcc/cp/parser.c:9280 0x64046e cp_parser_statement_seq_opt ../../gcc/gcc/cp/parser.c:9552 0x6405b6 cp_parser_compound_statement ../../gcc/gcc/cp/parser.c:9506 0x65196b cp_parser_function_body ../../gcc/gcc/cp/parser.c:18318 0x65196b cp_parser_ctor_initializer_opt_and_function_body ../../gcc/gcc/cp/parser.c:18354 0x6529af cp_parser_function_definition_after_declarator ../../gcc/gcc/cp/parser.c:22338 Please submit a full bug report, [etc.]