Commit dc8d2d00 by Jason Merrill Committed by Jason Merrill

Fix constexpr lvalue use of __real and __imag.

	* constexpr.c (potential_constant_expression_1): REALPART_EXPR and
	IMAGPART_EXPR can be lvalues.

From-SVN: r242349
parent ba1e69c0
2016-11-12 Jason Merrill <jason@redhat.com>
* constexpr.c (potential_constant_expression_1): REALPART_EXPR and
IMAGPART_EXPR can be lvalues.
DR 374
PR c++/56840
* pt.c (check_specialization_namespace): Allow any enclosing
......
......@@ -5105,6 +5105,8 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict,
#endif
return RECUR (t, any);
case REALPART_EXPR:
case IMAGPART_EXPR:
case COMPONENT_REF:
case BIT_FIELD_REF:
case ARROW_EXPR:
......@@ -5276,8 +5278,6 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict,
return true;
/* fall through. */
case REALPART_EXPR:
case IMAGPART_EXPR:
case CONJ_EXPR:
case SAVE_EXPR:
case FIX_TRUNC_EXPR:
......
// { dg-do compile { target c++11 } }
// { dg-options "" }
static _Complex int i;
static_assert (&__imag i == &__imag 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