Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/constinit15.C

raw
1 // PR c++/92058 - constinit malfunction in static data member.
2 // { dg-do compile { target c++20 } }
3
4 struct B {
5 B() {}
6 };
7
8 struct A {
9 constinit static inline B b1{}; // { dg-error "does not have a constant initializer|call to non-.constexpr. function" "" { target { ! implicit_constexpr } } }
10 };
11
12 int main() {
13 A a;
14 }