tree-optimization/116481 - avoid building function_type[]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / constexpr-99859-2.C
bloba249f4746664c54b7cc5c7faebfc36e98564ec6c
1 // PR c++/99859
2 // { dg-do compile { target c++14 } }
4 struct A
6   int i;
7   constexpr int f() { return i; }
8   constexpr A() : i(0) { i = f(); i = 1; i = f(); }
9 };
11 constexpr A a = A();
12 static_assert (a.i == 1, "");