fortran/openmp.cc: Fix var init and locus use to avoid uninit values [PR fortran...
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / constexpr-83116.C
blob18d79e2e1cced26e6613c032060b0402a84e6470
1 // PR c++/83116
2 // { dg-do run { target c++14 } }
3 // { dg-options "-O2" }
5 struct S {
6   constexpr S () : s(0) { foo (); }
7   constexpr int foo () { return s; }
8   int s;
9 };
11 int
12 main ()
14   static S var;
15   var.s = 5;
16   if (var.s != 5 || var.foo () != 5)
17     __builtin_abort ();