https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84449
Bug ID: 84449 Summary: [7/8 Regression] ICE with constexpr and deleted destructor Product: gcc Version: 8.0 Status: UNCONFIRMED Keywords: error-recovery, ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org Target Milestone: --- The following invalid code snippet (compiled with "-std=c++1z") triggers an ICE since GCC 7.1.0: ================================ struct A { constexpr A(int) {} ~A() = delete; }; struct B { A a; constexpr B() : a(0) {} }; ================================ bug.cc: In constructor 'constexpr B::B()': bug.cc:10:22: error: use of deleted function 'A::~A()' constexpr B() : a(0) {} ^ bug.cc:4:3: note: declared here ~A() = delete; ^ bug.cc:10:25: error: use of deleted function 'A::~A()' constexpr B() : a(0) {} ^ bug.cc:4:3: note: declared here ~A() = delete; ^ bug.cc:10:25: internal compiler error: tree check: expected target_expr, have error_mark in bot_manip, at cp/tree.c:2906 constexpr B() : a(0) {} ^ 0x78a40a tree_check_failed(tree_node const*, char const*, int, char const*, ...) ../../gcc/gcc/tree.c:9335 0x668c3b tree_check(tree_node*, char const*, int, char const*, tree_code) ../../gcc/gcc/tree.h:3132 0x668c3b bot_manip ../../gcc/gcc/cp/tree.c:2906 0x115823b walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, default_hash_traits<tree_node*> >*)) ../../gcc/gcc/tree.c:11400 0x9bd869 break_out_target_exprs(tree_node*) ../../gcc/gcc/cp/tree.c:3028 0x84d8d1 build_data_member_initialization ../../gcc/gcc/cp/constexpr.c:341 0x84e3fd build_constexpr_constructor_member_initializers ../../gcc/gcc/cp/constexpr.c:592 0x84e3fd massage_constexpr_body ../../gcc/gcc/cp/constexpr.c:726 0x858696 register_constexpr_fundef(tree_node*, tree_node*) ../../gcc/gcc/cp/constexpr.c:848 0x897f7f maybe_save_function_definition ../../gcc/gcc/cp/decl.c:15544 0x897f7f finish_function(bool) ../../gcc/gcc/cp/decl.c:15675 0x933ec9 cp_parser_function_definition_after_declarator ../../gcc/gcc/cp/parser.c:26691 0x935b9c cp_parser_late_parsing_for_member ../../gcc/gcc/cp/parser.c:27568 0x927fac cp_parser_class_specifier_1 ../../gcc/gcc/cp/parser.c:22716 0x929269 cp_parser_class_specifier ../../gcc/gcc/cp/parser.c:22742 0x929269 cp_parser_type_specifier ../../gcc/gcc/cp/parser.c:16748 0x936416 cp_parser_decl_specifier_seq ../../gcc/gcc/cp/parser.c:13606 0x93bae0 cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:12916 0x93ca88 cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:12863 0x9409e2 cp_parser_declaration ../../gcc/gcc/cp/parser.c:12761 Please submit a full bug report, [etc.]