PR c++/84560 - ICE capturing multi-dimensional VLA.
* tree.c (array_of_runtime_bound_p): False if the element is variably-modified. From-SVN: r258023
This commit is contained in:
parent
a2444ce970
commit
ed75f594a9
3 changed files with 18 additions and 0 deletions
|
@ -1,5 +1,9 @@
|
|||
2018-02-26 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/84560 - ICE capturing multi-dimensional VLA.
|
||||
* tree.c (array_of_runtime_bound_p): False if the element is
|
||||
variably-modified.
|
||||
|
||||
PR c++/84441 - ICE with base initialized from ?:
|
||||
* call.c (unsafe_copy_elision_p): Handle COND_EXPR.
|
||||
|
||||
|
|
|
@ -1043,6 +1043,8 @@ array_of_runtime_bound_p (tree t)
|
|||
{
|
||||
if (!t || TREE_CODE (t) != ARRAY_TYPE)
|
||||
return false;
|
||||
if (variably_modified_type_p (TREE_TYPE (t), NULL_TREE))
|
||||
return false;
|
||||
tree dom = TYPE_DOMAIN (t);
|
||||
if (!dom)
|
||||
return false;
|
||||
|
|
12
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-vla2.C
Normal file
12
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-vla2.C
Normal file
|
@ -0,0 +1,12 @@
|
|||
// PR c++/84560
|
||||
// { dg-do compile { target c++11 } }
|
||||
// { dg-options "" }
|
||||
|
||||
void f() {
|
||||
int n = 1;
|
||||
int m = 1;
|
||||
int d[n][m];
|
||||
[&]() {
|
||||
return d[1]; // { dg-error "variabl" }
|
||||
}();
|
||||
}
|
Loading…
Add table
Reference in a new issue