http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60683
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ice-on-invalid-code Status|UNCONFIRMED |NEW Last reconfirmed| |2014-03-27 Ever confirmed|0 |1 --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- The code has undefined behaviour, you are not allowed to add declarations to namespace std, especially not std::initializer_list which is very closely tied to the compiler. On trunk we get the following stack trace: il.cc: In function ‘int test()’: il.cc:16:23: error: converting to ‘X’ from initializer list would use explicit constructor ‘X::X(std::initializer_list<int>)’ X x = {10, 10, 10}; ^ il.cc:16:23: internal compiler error: Segmentation fault 0xb5682f crash_signal /home/jwakely/src/gcc/gcc/gcc/toplev.c:337 0x553bd9 contains_struct_check /home/jwakely/src/gcc/gcc/gcc/tree.h:2826 0x553bd9 convert_like_real /home/jwakely/src/gcc/gcc/gcc/cp/call.c:6129 0x555121 build_over_call /home/jwakely/src/gcc/gcc/gcc/cp/call.c:7010 0x5537ec convert_like_real /home/jwakely/src/gcc/gcc/gcc/cp/call.c:6032 0x55310c convert_like_real /home/jwakely/src/gcc/gcc/gcc/cp/call.c:6162 0x558196 perform_implicit_conversion_flags(tree_node*, tree_node*, int, int) /home/jwakely/src/gcc/gcc/gcc/cp/call.c:9091 0x6a3617 ocp_convert(tree_node*, tree_node*, int, int, int) /home/jwakely/src/gcc/gcc/gcc/cp/cvt.c:863 0x6b0c0d expand_default_init /home/jwakely/src/gcc/gcc/gcc/cp/init.c:1618 0x6b0c0d expand_aggr_init_1 /home/jwakely/src/gcc/gcc/gcc/cp/init.c:1787 0x6b33aa build_aggr_init(tree_node*, tree_node*, int, int) /home/jwakely/src/gcc/gcc/gcc/cp/init.c:1538 0x566e6c build_aggr_init_full_exprs /home/jwakely/src/gcc/gcc/gcc/cp/decl.c:5591 0x566e6c check_initializer /home/jwakely/src/gcc/gcc/gcc/cp/decl.c:5726 0x579d75 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int) /home/jwakely/src/gcc/gcc/gcc/cp/decl.c:6394 0x66bcff cp_parser_init_declarator /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:16858 0x66d5fe cp_parser_simple_declaration /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:11225 0x651c00 cp_parser_block_declaration /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:11106 0x652cc0 cp_parser_declaration_statement /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:10753 0x653327 cp_parser_statement /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:9486 0x6540ae cp_parser_statement_seq_opt /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:9764 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions.