// { dg-do compile { target c++17 } } template struct A { static constexpr auto x = T::x; // { dg-error "incomplete" } }; struct B; A a; struct B { static constexpr auto x = 42; }; auto x = a.x;