Commit b6b99021 by Jason Merrill Committed by Jason Merrill

re PR c++/67411 (internal compiler error: in tsubst_copy, at cp/pt.c:13473)

	PR c++/67411

	* decl2.c (decl_maybe_constant_var_p): A proxy isn't constant.

From-SVN: r231862
parent 60424a41
2015-12-20 Jason Merrill <jason@redhat.com>
PR c++/67411
* decl2.c (decl_maybe_constant_var_p): A proxy isn't constant.
2015-12-18 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/68978
......
......@@ -4222,6 +4222,9 @@ decl_maybe_constant_var_p (tree decl)
return false;
if (DECL_DECLARED_CONSTEXPR_P (decl))
return true;
if (DECL_VALUE_EXPR (decl))
/* A proxy isn't constant. */
return false;
return (CP_TYPE_CONST_NON_VOLATILE_P (type)
&& INTEGRAL_OR_ENUMERATION_TYPE_P (type));
}
......
// PR c++/67411
// { dg-do compile { target c++14 } }
template <class T>
void f()
{
int i = 42;
[x = i] {
[&](auto) {
[=] { return x; }();
}(1);
}();
}
int main()
{
f<int>();
}
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