8sa1-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-71828.C
Jakub Jelinek 87713c6a50 re PR c++/71828 (ICE on valid C++11 code with constexpr __Complex int variable declaration: in operand_equal_p, at fold-const.c:2790)
PR c++/71828
	* constexpr.c (cxx_eval_constant_expression) <case REALPART_EXPR>:
	For lval don't use cxx_eval_unary_expression and instead recurse
	and if needed rebuild the reference.

	* g++.dg/cpp0x/constexpr-71828.C: New test.

From-SVN: r238442
2016-07-18 20:43:19 +02:00

6 lines
135 B
C

// PR c++/71828
// { dg-do compile { target c++11 } }
constexpr _Complex int a { 1, 2 };
static_assert (& __imag a != &__real a, "");