namespace N { template struct S { void f() {} }; } namespace K { template <> void N::S::f() {} // { dg-error "namespace|definition" } }