// PR c++/99213 // { dg-do compile { target c++14 } } template struct A { template static auto f() { struct S1{}; return S1{}; } }; using type = void; using type = decltype(A::f()); // { dg-error "A::f\\(\\)::S1" } template struct B { static auto f() { struct S2{}; return S2{}; } }; using type = void; using type = decltype(B::f()); // { dg-error "B::f\\(\\)::S2" }