Debian Codegraph @

gcc/testsuite/g++.dg/cpp1y/constexpr-99859-2.C

raw
1 // PR c++/99859
2 // { dg-do compile { target c++14 } }
3
4 struct A
5 {
6 int i;
7 constexpr int f() { return i; }
8 constexpr A() : i(0) { i = f(); i = 1; i = f(); }
9 };
10
11 constexpr A a = A();
12 static_assert (a.i == 1, "");