Commit 3ae9a8b7 by Jason Merrill Committed by Jason Merrill

re PR c++/70648 (adplug-xmms fails to compile)

	PR c++/70648

	* constexpr.c (cxx_eval_store_expression): Also copy
	CONSTRUCTOR_NO_IMPLICIT_ZERO.

From-SVN: r234989
parent bc773aad
2016-04-14 Jason Merrill <jason@redhat.com>
PR c++/70648
* constexpr.c (cxx_eval_store_expression): Also copy
CONSTRUCTOR_NO_IMPLICIT_ZERO.
2016-04-14 Martin Sebor <msebor@redhat.com> 2016-04-14 Martin Sebor <msebor@redhat.com>
PR c++/69517 PR c++/69517
......
...@@ -3149,6 +3149,8 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t, ...@@ -3149,6 +3149,8 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t,
CONSTRUCTOR_ELTS (*valp) = CONSTRUCTOR_ELTS (init); CONSTRUCTOR_ELTS (*valp) = CONSTRUCTOR_ELTS (init);
TREE_CONSTANT (*valp) = TREE_CONSTANT (init); TREE_CONSTANT (*valp) = TREE_CONSTANT (init);
TREE_SIDE_EFFECTS (*valp) = TREE_SIDE_EFFECTS (init); TREE_SIDE_EFFECTS (*valp) = TREE_SIDE_EFFECTS (init);
CONSTRUCTOR_NO_IMPLICIT_ZERO (*valp)
= CONSTRUCTOR_NO_IMPLICIT_ZERO (init);
} }
else else
*valp = init; *valp = init;
......
// PR c++/70648
// { dg-do compile { target c++11 } }
struct C
{
template <class... U>
constexpr C (...) : c { static_cast<U &&>(0)... } {}
int c[1];
};
static constexpr int b = C{}.c[0];
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