http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58701
Bug ID: 58701 Summary: [4.9 Regression] [c++11] ICE initializing member of static union 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 valid code snippet (compiled with "-std=c++11") triggers an ICE on trunk (since at least 4.9.0 20130920): =============== static union { union { int i = 0; }; }; =============== bug.cc: In constructor 'constexpr<anonymous union>::<constructor>()': bug.cc:2:1: internal compiler error: tree check: accessed operand 2 of indirect_ref with 1 operands in build_anon_member_initialization, at cp/semantics.c:7404 { ^ 0xd201a7 tree_operand_check_failed(int, tree_node const*, char const*, int, char const*) ../../gcc/gcc/tree.c:9499 0x6d2677 tree_operand_check ../../gcc/gcc/tree.h:3109 0x6d2677 build_anon_member_initialization ../../gcc/gcc/cp/semantics.c:7404 0x6d2677 build_data_member_initialization ../../gcc/gcc/cp/semantics.c:7533 0x6d338d build_constexpr_constructor_member_initializers ../../gcc/gcc/cp/semantics.c:7652 0x6d338d massage_constexpr_body ../../gcc/gcc/cp/semantics.c:7752 0x6da9a3 register_constexpr_fundef(tree_node*, tree_node*) ../../gcc/gcc/cp/semantics.c:7856 0x56ea38 maybe_save_function_definition ../../gcc/gcc/cp/decl.c:13823 0x56ea38 finish_function(int) ../../gcc/gcc/cp/decl.c:13944 0x6acc19 synthesize_method(tree_node*) ../../gcc/gcc/cp/method.c:809 0x61e379 mark_used(tree_node*, int) ../../gcc/gcc/cp/decl2.c:4778 0x54d0b6 build_over_call ../../gcc/gcc/cp/call.c:7116 0x548eae build_new_method_call_1 ../../gcc/gcc/cp/call.c:7813 0x548eae build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, tree_node*, int, tree_node**, int) ../../gcc/gcc/cp/call.c:7883 0x549e22 build_special_member_call(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, tree_node*, int, int) ../../gcc/gcc/cp/call.c:7440 0x69eba7 expand_default_init ../../gcc/gcc/cp/init.c:1668 0x69eba7 expand_aggr_init_1 ../../gcc/gcc/cp/init.c:1769 0x6a1779 build_aggr_init(tree_node*, tree_node*, int, int) ../../gcc/gcc/cp/init.c:1520 0x55e005 build_aggr_init_full_exprs ../../gcc/gcc/cp/decl.c:5552 0x55e005 check_initializer ../../gcc/gcc/cp/decl.c:5687 Please submit a full bug report, [etc.]