re PR c++/42059 ([c++0x] ICE with initializer list for VLA)
PR c++/42059 * typeck.c (cp_build_modify_expr): For initializer list call check_array_initializer to make sure lhs isn't a VLA. * g++.dg/cpp0x/initlist26.C: New test. From-SVN: r154237
This commit is contained in:
parent
5a887be717
commit
84526801f6
@ -1,3 +1,9 @@
|
||||
2009-11-17 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/42059
|
||||
* typeck.c (cp_build_modify_expr): For initializer list call
|
||||
check_array_initializer to make sure lhs isn't a VLA.
|
||||
|
||||
2009-11-16 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/189, c++/9937, c++/13950, DR 176
|
||||
|
@ -6239,7 +6239,11 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs,
|
||||
int from_array;
|
||||
|
||||
if (BRACE_ENCLOSED_INITIALIZER_P (rhs))
|
||||
rhs = digest_init (lhstype, rhs);
|
||||
{
|
||||
if (check_array_initializer (lhs, lhstype, rhs))
|
||||
return error_mark_node;
|
||||
rhs = digest_init (lhstype, rhs);
|
||||
}
|
||||
|
||||
else if (!same_or_base_type_p (TYPE_MAIN_VARIANT (lhstype),
|
||||
TYPE_MAIN_VARIANT (TREE_TYPE (rhs))))
|
||||
|
@ -1,3 +1,8 @@
|
||||
2009-11-17 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/42059
|
||||
* g++.dg/cpp0x/initlist26.C: New test.
|
||||
|
||||
2009-11-16 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/189, c++/9937, c++/13950, DR 176
|
||||
|
10
gcc/testsuite/g++.dg/cpp0x/initlist26.C
Normal file
10
gcc/testsuite/g++.dg/cpp0x/initlist26.C
Normal file
@ -0,0 +1,10 @@
|
||||
// PR c++/42059
|
||||
// { dg-do compile }
|
||||
// { dg-options "-std=gnu++0x" }
|
||||
|
||||
void
|
||||
foo (int i)
|
||||
{
|
||||
int a[i];
|
||||
a = { }; // { dg-error "may not be initialized" }
|
||||
}
|
Loading…
Reference in New Issue
Block a user