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