// PR c++/116567 // { dg-do compile { target c++20 } } struct X { int n; }; template auto v1 = F; template auto v1g = F; template struct A { template static inline auto v2 = F; template static inline auto v2g = F; template struct B { template static inline auto v3 = F; template static inline auto v3g = F; template static void f() { static_assert(v1().n == 1); static_assert(v1g(42).n == 1 + 42); static_assert(v2().n == 2); static_assert(v2g(42).n == 2 + 42); static_assert(v3().n == 3); static_assert(v3g(42).n == 3 + 42); } }; }; int main() { A::B::f(); }