https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78345
Bug ID: 78345 Summary: ice on invalid c++ code on x86_64-linux-gnu (internal compiler error: in cxx_eval_outermost_constant_expr, at cp/constexpr.c:4464) Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: chengniansun at gmail dot com Target Milestone: --- $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto --prefix=/usr/local/gcc-trunk --disable-bootstrap Thread model: posix gcc version 7.0.0 20161110 (experimental) [trunk revision 242039] (GCC) $ $ gcc-trunk small.C small.C: In lambda function: small.C:3:11: error: expected ‘{’ before ‘;’ token } a[] =[] ; ^ small.C: At global scope: small.C:3:3: error: initializer fails to determine size of ‘a’ } a[] =[] ; ^ small.C:3:11: internal compiler error: in cxx_eval_outermost_constant_expr, at cp/constexpr.c:4464 } a[] =[] ; ^ 0x8cc511 cxx_eval_outermost_constant_expr ../../gcc-source-trunk/gcc/cp/constexpr.c:4463 0x8cf751 maybe_constant_init(tree_node*, tree_node*) ../../gcc-source-trunk/gcc/cp/constexpr.c:4803 0x73d02a store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, int) ../../gcc-source-trunk/gcc/cp/typeck2.c:819 0x69397c check_initializer ../../gcc-source-trunk/gcc/cp/decl.c:6307 0x6bfbe9 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int) ../../gcc-source-trunk/gcc/cp/decl.c:6969 0x7c0a45 cp_parser_init_declarator ../../gcc-source-trunk/gcc/cp/parser.c:19070 0x7c12d9 cp_parser_simple_declaration ../../gcc-source-trunk/gcc/cp/parser.c:12656 0x7c1611 cp_parser_block_declaration ../../gcc-source-trunk/gcc/cp/parser.c:12524 0x7c86d0 cp_parser_declaration ../../gcc-source-trunk/gcc/cp/parser.c:12421 0x7c8ad4 cp_parser_declaration_seq_opt ../../gcc-source-trunk/gcc/cp/parser.c:12297 0x7c8e18 cp_parser_translation_unit ../../gcc-source-trunk/gcc/cp/parser.c:4360 0x7c8e18 c_parse_file() ../../gcc-source-trunk/gcc/cp/parser.c:37988 0x92e852 c_common_parse_file() ../../gcc-source-trunk/gcc/c-family/c-opts.c:1086 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. $ $ cat small.C struct { const int i; } a[] =[] ; $