/cp
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / constexpr-void2.C
blob321a35ed29ba4c861d883d11b9fa99bdb33bf6c1
1 // PR c++/64547
2 // { dg-do compile { target c++14 } }
4 struct X
6     int x;
7     constexpr int get() const {return x;}
8     constexpr void set(int foo) {x = foo;}
9 };
11 constexpr int bar()
13     X x{42};
14     x.set(666);
15     return x.get();
18 int main()
20     constexpr int foo = bar();