Commit 9e01a71f by Jason Merrill Committed by Jason Merrill

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
parent e429bc35
2014-02-21 Jason Merrill <jason@redhat.com> 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 PR c++/60251
* lambda.c (is_normal_capture_proxy): Handle VLA capture. * lambda.c (is_normal_capture_proxy): Handle VLA capture.
......
...@@ -17233,7 +17233,8 @@ cp_parser_direct_declarator (cp_parser* parser, ...@@ -17233,7 +17233,8 @@ cp_parser_direct_declarator (cp_parser* parser,
"array bound is not an integer constant"); "array bound is not an integer constant");
bounds = error_mark_node; 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. */ /* Remember this wasn't a constant-expression. */
bounds = build_nop (TREE_TYPE (bounds), bounds); bounds = build_nop (TREE_TYPE (bounds), bounds);
......
// PR c++/60250
// { dg-options "-std=c++1y -pedantic-errors" }
template<typename> void foo()
{
typedef int T[ ([](){ return 1; }()) ]; // { dg-error "runtime bound" }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment