Commit a1408b7e by Jason Merrill Committed by Jason Merrill

re PR c++/64080 ([C++14]ICE in cxx_eval_store_expression)

	PR c++/64080
	* constexpr.c (cxx_eval_store_expression): Handle non-decl store
	targets.

From-SVN: r218401
parent 6dc82110
2014-12-03 Jason Merrill <jason@redhat.com>
PR c++/64080
* constexpr.c (cxx_eval_store_expression): Handle non-decl store
targets.
2014-12-03 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/63558
......
......@@ -2583,19 +2583,22 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t,
default:
object = probe;
gcc_assert (DECL_P (object));
}
}
/* And then find/build up our initializer for the path to the subobject
we're initializing. */
tree *valp = ctx->values->get (object);
tree *valp;
if (DECL_P (object))
valp = ctx->values->get (object);
else
valp = NULL;
if (!valp)
{
/* A constant-expression cannot modify objects from outside the
constant-expression. */
if (!ctx->quiet)
error ("modification of %qD is not a constant-expression", object);
error ("modification of %qE is not a constant-expression", object);
*non_constant_p = true;
return t;
}
......
// PR c++/64080
// { dg-do compile { target c++14 } }
constexpr void foo (int&& i) { i = 0; }
void bar(int&& i)
{
bool b = noexcept(foo(static_cast<int&&>(i)));
}
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