Commit 133bc698 by Jason Merrill Committed by Jason Merrill

re PR c++/66445 (ICE with lambda in stmt expression in a template)

	PR c++/66445
	* constexpr.c (potential_constant_expression_1): Handle a
	DECL_EXPR of TYPE_DECL.

From-SVN: r224382
parent acb2970c
2015-06-11 Jason Merrill <jason@redhat.com> 2015-06-11 Jason Merrill <jason@redhat.com>
PR c++/66445
* constexpr.c (potential_constant_expression_1): Handle a
DECL_EXPR of TYPE_DECL.
PR c++/66450 PR c++/66450
* constexpr.c (cxx_eval_store_expression): Avoid messing up outer * constexpr.c (cxx_eval_store_expression): Avoid messing up outer
ctx->ctor. ctx->ctor.
......
...@@ -4462,6 +4462,11 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, ...@@ -4462,6 +4462,11 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict,
} }
return false; return false;
case TYPE_DECL:
case TAG_DEFN:
/* We can see these in statement-expressions. */
return true;
default: default:
if (objc_is_property_ref (t)) if (objc_is_property_ref (t))
return false; return false;
......
// PR c++/66445
// { dg-options "" }
template <typename> void foo ()
{
int a = ({ struct A{} b; 42; });
}
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