Improve location information on "reused" class template specialization
decls. Test and document the semantic location of class template
specialization definitions that occur within a scope enclosing the
scope of the class template.
llvm-svn: 65478
diff --git a/clang/test/SemaTemplate/class-template-spec.cpp b/clang/test/SemaTemplate/class-template-spec.cpp
index 4ae1b9b..15c797a 100644
--- a/clang/test/SemaTemplate/class-template-spec.cpp
+++ b/clang/test/SemaTemplate/class-template-spec.cpp
@@ -52,8 +52,11 @@
namespace N {
template<typename T> struct B; // expected-note 2{{template is declared here}}
+ template<> struct ::N::B<char>; // okay
template<> struct ::N::B<short>; // okay
template<> struct ::N::B<int>; // okay
+
+ int f(int);
}
template<> struct N::B<int> { }; // okay
@@ -65,3 +68,7 @@
template<> struct ::A<long double>; // expected-error{{class template specialization of 'A' must occur in the global scope}}
}
+
+template<> struct N::B<char> {
+ int testf(int x) { return f(x); }
+};