8sa1-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-static12.C
Jason Merrill f64e0c029c constexpr.c (maybe_constant_init): Pull out TARGET_EXPR_INITIAL.
* constexpr.c (maybe_constant_init): Pull out TARGET_EXPR_INITIAL.

	(cxx_eval_outermost_constant_expr): Don't return a CONSTRUCTOR
	with CONSTRUCTOR_NO_IMPLICIT_ZERO.
	(cxx_eval_call_expression): Clear CONSTRUCTOR_NO_IMPLICIT_ZERO.

From-SVN: r241531
2016-10-25 13:23:44 -04:00

21 lines
290 B
C

// { dg-do compile { target c++11 } }
// { dg-final { scan-assembler-not "_ZNSt10unique_ptrC1Ei" } }
namespace std {
struct unique_ptr {
constexpr unique_ptr(int) : p() { }
~unique_ptr() { }
void* p;
};
}
void f()
{
static std::unique_ptr p(1);
}
int main()
{
f();
}