(root)/
gcc-13.2.0/
gcc/
testsuite/
g++.dg/
cpp1z/
static2.C
// { dg-do compile { target c++17 } }

template <class T>
struct A
{
  static constexpr auto x = T::x; // { dg-error "incomplete" }
};

struct B;
A<B> a;

struct B
{
  static constexpr auto x = 42;
};

auto x = a.x;