re PR c++/60250 ([c++1y] ICE using lambda for array size)
PR c++/60250 * parser.c (cp_parser_direct_declarator): Don't wrap a type-dependent expression in a NOP_EXPR. From-SVN: r207996
This commit is contained in:
parent
e429bc3555
commit
9e01a71f1a
@ -1,5 +1,9 @@
|
||||
2014-02-21 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/60250
|
||||
* parser.c (cp_parser_direct_declarator): Don't wrap a
|
||||
type-dependent expression in a NOP_EXPR.
|
||||
|
||||
PR c++/60251
|
||||
* lambda.c (is_normal_capture_proxy): Handle VLA capture.
|
||||
|
||||
|
@ -17233,7 +17233,8 @@ cp_parser_direct_declarator (cp_parser* parser,
|
||||
"array bound is not an integer constant");
|
||||
bounds = error_mark_node;
|
||||
}
|
||||
else if (processing_template_decl)
|
||||
else if (processing_template_decl
|
||||
&& !type_dependent_expression_p (bounds))
|
||||
{
|
||||
/* Remember this wasn't a constant-expression. */
|
||||
bounds = build_nop (TREE_TYPE (bounds), bounds);
|
||||
|
7
gcc/testsuite/g++.dg/cpp1y/vla12.C
Normal file
7
gcc/testsuite/g++.dg/cpp1y/vla12.C
Normal file
@ -0,0 +1,7 @@
|
||||
// PR c++/60250
|
||||
// { dg-options "-std=c++1y -pedantic-errors" }
|
||||
|
||||
template<typename> void foo()
|
||||
{
|
||||
typedef int T[ ([](){ return 1; }()) ]; // { dg-error "runtime bound" }
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user