This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/78345] [5/6/7 Regression] ICE on invalid c++ code on x86_64-linux-gnu (internal compiler error: in cxx_eval_outermost_constant_expr, at cp/constexpr.c:4464)
- From: "reichelt at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 04 Feb 2017 22:51:04 +0000
- Subject: [Bug c++/78345] [5/6/7 Regression] ICE on invalid c++ code on x86_64-linux-gnu (internal compiler error: in cxx_eval_outermost_constant_expr, at cp/constexpr.c:4464)
- Auto-submitted: auto-generated
- References: <bug-78345-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78345
Volker Reichelt <reichelt at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords|error-recovery |
Priority|P4 |P3
CC| |reichelt at gcc dot gnu.org
Known to work|4.9.4 |4.8.4
Known to fail| |4.9.4
--- Comment #4 from Volker Reichelt <reichelt at gcc dot gnu.org> ---
Here's a slightly modified testcase that triggers the ICE without a proper
error message before:
===================
struct
{
const int i;
} a[1] = []{};
===================
bug.cc:4:13: internal compiler error: in cxx_eval_outermost_constant_expr, at
cp/constexpr.c:4581
} a[1] = []{};
^
0x83e276 cxx_eval_outermost_constant_expr
../../gcc/gcc/cp/constexpr.c:4580
0x841314 maybe_constant_init(tree_node*, tree_node*)
../../gcc/gcc/cp/constexpr.c:4913
0x6b3794 store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
../../gcc/gcc/cp/typeck2.c:819
0x61049b check_initializer
../../gcc/gcc/cp/decl.c:6359
0x63a8bc cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/gcc/cp/decl.c:7024
0x738acc cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:19374
0x73931c cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:12768
0x73a0d5 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:12593
0x712d34 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12491
0x74353b cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12367
0x74381a cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4366
0x74381a c_parse_file()
../../gcc/gcc/cp/parser.c:38382
0x8a1fa3 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1107
Please submit a full bug report, [etc.]
So I'm removing the error-recovery tag and reset the importance to P3.
Also GCC 4.9.x wrongfully accepts this code snippet,
whereas GCC 4.8.x and before correctly reject the code.