1 // PR c++/91360 - Implement C++20 P1143R2: constinit
2 // { dg-do compile { target c++11 } }
3 // Test that 'constinit' isn't recognized pre-C++2a, but '__constinit' is.
4 
5 constinit int g = 42; // { dg-error ".constinit. does not name a type" "" { target c++17_down } }
6 __constinit int g2 = 42;
7 static __constinit int g3 = 42;
8 
9 void
fn()10 fn ()
11 {
12   static constinit int x = 69; // { dg-error ".constinit. does not name a type" "" { target c++17_down } }
13   static __constinit int x2 = 69;
14 }
15