namespace N {
  template <typename T>
  struct S {
    void f() {}
  };
}

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


syntax highlighted by Code2HTML, v. 0.9.1