re PR c++/60251 ([c++11] ICE capturing variable-length array)
PR c++/60251 * lambda.c (is_normal_capture_proxy): Handle VLA capture. From-SVN: r207995
This commit is contained in:
parent
a866509aeb
commit
e429bc3555
3 changed files with 15 additions and 0 deletions
|
@ -1,5 +1,8 @@
|
|||
2014-02-21 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/60251
|
||||
* lambda.c (is_normal_capture_proxy): Handle VLA capture.
|
||||
|
||||
PR c++/60167
|
||||
PR c++/60222
|
||||
PR c++/58606
|
||||
|
|
|
@ -250,6 +250,10 @@ is_normal_capture_proxy (tree decl)
|
|||
/* It's not a capture proxy. */
|
||||
return false;
|
||||
|
||||
if (variably_modified_type_p (TREE_TYPE (decl), NULL_TREE))
|
||||
/* VLA capture. */
|
||||
return true;
|
||||
|
||||
/* It is a capture proxy, is it a normal capture? */
|
||||
tree val = DECL_VALUE_EXPR (decl);
|
||||
if (val == error_mark_node)
|
||||
|
|
8
gcc/testsuite/g++.dg/cpp1y/vla11.C
Normal file
8
gcc/testsuite/g++.dg/cpp1y/vla11.C
Normal file
|
@ -0,0 +1,8 @@
|
|||
// PR c++/60251
|
||||
// { dg-options "-std=c++1y -pedantic-errors" }
|
||||
|
||||
void foo(int n)
|
||||
{
|
||||
int x[n];
|
||||
[&x]() { decltype(x) y; }; // { dg-error "decltype of array of runtime bound" }
|
||||
}
|
Loading…
Add table
Reference in a new issue