This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77284] New: ICE on valid C++11 code using initializer list: in potential_constant_expression_1, at cp/constexpr.c:5480
- From: "su at cs dot ucdavis.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 17 Aug 2016 21:24:22 +0000
- Subject: [Bug c++/77284] New: ICE on valid C++11 code using initializer list: in potential_constant_expression_1, at cp/constexpr.c:5480
- Authentication-results: sourceware.org; auth=none
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77284
Bug ID: 77284
Summary: ICE on valid C++11 code using initializer list: in
potential_constant_expression_1, at
cp/constexpr.c:5480
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: su at cs dot ucdavis.edu
Target Milestone: ---
It also affects 6.x and 5.x, and is a regression from 4.9.x.
$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-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 20160817 (experimental) [trunk revision 239527] (GCC)
$
$ g++-4.9 -std=c++11 -c small.cpp
$ clang++-3.8 -std=c++11 -c small.cpp
$
$ g++-trunk -std=c++11 -c small.cpp
small.cpp: In function ‘void foo(A&)’:
small.cpp:10:18: sorry, unimplemented: unexpected AST of kind cleanup_stmt
for (A a : { v }) {};
^
small.cpp:10:18: internal compiler error: in potential_constant_expression_1,
at cp/constexpr.c:5480
0x8bf447 potential_constant_expression_1
../../gcc-source-trunk/gcc/cp/constexpr.c:5480
0x8bf317 potential_constant_expression_1
../../gcc-source-trunk/gcc/cp/constexpr.c:5039
0x8be601 potential_constant_expression_1
../../gcc-source-trunk/gcc/cp/constexpr.c:5399
0x8bef10 potential_constant_expression_1
../../gcc-source-trunk/gcc/cp/constexpr.c:5281
0x8c0050 potential_static_init_expression
../../gcc-source-trunk/gcc/cp/constexpr.c:5497
0x8c0050 potential_nondependent_static_init_expression(tree_node*)
../../gcc-source-trunk/gcc/cp/constexpr.c:5545
0x8c1579 maybe_constant_init(tree_node*, tree_node*)
../../gcc-source-trunk/gcc/cp/constexpr.c:4704
0x67f83b set_up_extended_ref_temp
../../gcc-source-trunk/gcc/cp/call.c:9965
0x67f83b extend_ref_init_temps_1
../../gcc-source-trunk/gcc/cp/call.c:10123
0x7314b0 store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
../../gcc-source-trunk/gcc/cp/typeck2.c:799
0x68cb8c check_initializer
../../gcc-source-trunk/gcc/cp/decl.c:6230
0x6b732d cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc-source-trunk/gcc/cp/decl.c:6888
0x78dd82 cp_convert_range_for(tree_node*, tree_node*, tree_node*, bool)
../../gcc-source-trunk/gcc/cp/parser.c:11449
0x7be0d0 cp_parser_range_for
../../gcc-source-trunk/gcc/cp/parser.c:11333
0x7be0d0 cp_parser_for
../../gcc-source-trunk/gcc/cp/parser.c:11234
0x7be0d0 cp_parser_iteration_statement
../../gcc-source-trunk/gcc/cp/parser.c:11733
0x7b3d99 cp_parser_statement
../../gcc-source-trunk/gcc/cp/parser.c:10446
0x7b533c cp_parser_statement_seq_opt
../../gcc-source-trunk/gcc/cp/parser.c:10857
0x7b542f cp_parser_compound_statement
../../gcc-source-trunk/gcc/cp/parser.c:10811
0x7b55df cp_parser_function_body
../../gcc-source-trunk/gcc/cp/parser.c:20830
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.
$
---------------------------------
#include <initializer_list>
struct A
{
~A () {}
};
void foo (A & v)
{
for (A a : { v }) {};
}