Give a more appropriate diagnostic when a template specialization or
instantiation appears in a non-enclosing namespace (the previous diagnostic
talked about the C++98 rule even in C++11 mode).
llvm-svn: 196642
diff --git a/clang/test/CXX/temp/temp.spec/no-body.cpp b/clang/test/CXX/temp/temp.spec/no-body.cpp
index a4d7914..61d285b 100644
--- a/clang/test/CXX/temp/temp.spec/no-body.cpp
+++ b/clang/test/CXX/temp/temp.spec/no-body.cpp
@@ -37,7 +37,7 @@
namespace exp_spec {
#ifndef FIXING
template<> void f0<int>(int) { } // expected-error {{no function template matches function template specialization 'f0'}}
- template<> struct x0<int> { }; // expected-error {{class template specialization of 'x0' must originally be declared in the global scope}}
+ template<> struct x0<int> { }; // expected-error {{class template specialization of 'x0' must occur at global scope}}
#endif
}
@@ -51,7 +51,7 @@
template void f1<int>(int) { } // expected-error {{explicit template instantiation cannot have a definition; if this definition is meant to be an explicit specialization, add '<>' after the 'template' keyword}} \
expected-error {{no function template matches function template specialization 'f1'}}
template struct x1<int> { }; // expected-error {{explicit template instantiation cannot have a definition; if this definition is meant to be an explicit specialization, add '<>' after the 'template' keyword}} \
- expected-error {{class template specialization of 'x1' must originally be declared in the global scope}}
+ expected-error {{class template specialization of 'x1' must occur at global scope}}
#endif
}
diff --git a/clang/test/CXX/temp/temp.spec/temp.expl.spec/p2-0x.cpp b/clang/test/CXX/temp/temp.spec/temp.expl.spec/p2-0x.cpp
index 75b198e..1a7065e 100644
--- a/clang/test/CXX/temp/temp.spec/temp.expl.spec/p2-0x.cpp
+++ b/clang/test/CXX/temp/temp.spec/temp.expl.spec/p2-0x.cpp
@@ -79,7 +79,7 @@
N0::X0<void> test_X0;
namespace N1 {
- template<> struct N0::X0<const void> { }; // expected-error{{class template specialization of 'X0' must originally be declared in namespace 'N0'}}
+ template<> struct N0::X0<const void> { }; // expected-error{{class template specialization of 'X0' not in a namespace enclosing 'N0'}}
}
namespace N0 {
diff --git a/clang/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp b/clang/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp
index c972bf7..4fbc45a 100644
--- a/clang/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp
+++ b/clang/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp
@@ -80,7 +80,7 @@
N0::X0<void> test_X0;
namespace N1 {
- template<> struct N0::X0<const void> { }; // expected-error{{originally}}
+ template<> struct N0::X0<const void> { }; // expected-error{{not in a namespace enclosing 'N0'}}
}
namespace N0 {
diff --git a/clang/test/SemaTemplate/class-template-spec.cpp b/clang/test/SemaTemplate/class-template-spec.cpp
index f9015b3..e82537a 100644
--- a/clang/test/SemaTemplate/class-template-spec.cpp
+++ b/clang/test/SemaTemplate/class-template-spec.cpp
@@ -91,7 +91,7 @@
namespace M {
template<> struct ::N::B<short> { }; // expected-error{{class template specialization of 'B' not in a namespace enclosing 'N'}}
- template<> struct ::A<long double>; // expected-error{{originally}}
+ template<> struct ::A<long double>; // expected-error{{must occur at global scope}}
}
template<> struct N::B<char> {