Message ID | 20191108213842.GA21634@redhat.com |
---|---|
State | New |
Headers | show |
Series | [C++,COMMITTED] Add test for c++/92058 | expand |
diff --git gcc/testsuite/g++.dg/cpp2a/constinit15.C gcc/testsuite/g++.dg/cpp2a/constinit15.C new file mode 100644 index 00000000000..32594334330 --- /dev/null +++ gcc/testsuite/g++.dg/cpp2a/constinit15.C @@ -0,0 +1,14 @@ +// PR c++/92058 - constinit malfunction in static data member. +// { dg-do compile { target c++2a } } + +struct B { + B() {} +}; + +struct A { + constinit static inline B b1{}; // { dg-error "does not have a constant initializer|call to non-.constexpr. function" } +}; + +int main() { + A a; +}