blob: 50bc13f2ce9f98e92de3586507dd98c4dad63edc [file] [log] [blame]
// PR c++/91360 - Implement C++20 P1143R2: constinit
// { dg-do compile { target c++20 } }
// Variable templates.
int nonconst;
template<typename T>
constinit T v1 = 42;
template<typename T>
constinit T v2 = nonconst; // { dg-error "does not have a constant initializer|not usable" }
void
fn ()
{
v1<int>;
v2<int>;
}