diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-18 02:28:33 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-18 02:28:33 +0000 |
| commit | 050d261ec7bb2057b007b06ac9bd2ffc541cb0f5 (patch) | |
| tree | 626e180e9a89d5429629d825182922a42d5d86fb /clang/test/SemaTemplate | |
| parent | 43d4dd49bf2fddded7a142371e9d8b4d94e6381b (diff) | |
| download | bcm5719-llvm-050d261ec7bb2057b007b06ac9bd2ffc541cb0f5.tar.gz bcm5719-llvm-050d261ec7bb2057b007b06ac9bd2ffc541cb0f5.zip | |
Refactor the checking for explicit template instantiations being performed in
the right namespace in C++11 mode. Teach the code to prefer the 'must be in
precisely this namespace' diagnostic whenever that's true, and fix a defect
which resulted in the -Wc++11-compat warning in C++98 mode sometimes being
omitted.
llvm-svn: 142329
Diffstat (limited to 'clang/test/SemaTemplate')
| -rw-r--r-- | clang/test/SemaTemplate/temp_explicit.cpp | 6 | ||||
| -rw-r--r-- | clang/test/SemaTemplate/temp_explicit_cxx0x.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/clang/test/SemaTemplate/temp_explicit.cpp b/clang/test/SemaTemplate/temp_explicit.cpp index 76244c25e82..8a56d724ea1 100644 --- a/clang/test/SemaTemplate/temp_explicit.cpp +++ b/clang/test/SemaTemplate/temp_explicit.cpp @@ -80,7 +80,7 @@ struct X5 { void f(T&); }; - struct Inner2 { + struct Inner2 { // expected-note {{here}} struct VeryInner { void g(T*); // expected-error 2{{pointer to a reference}} }; @@ -98,7 +98,7 @@ void f4(X5<float&>::Inner2); template struct X5<float&>::Inner2; // expected-note{{instantiation}} namespace N3 { - template struct N2::X5<int>::Inner2; + template struct N2::X5<int>::Inner2; // expected-warning {{explicit instantiation of 'Inner2' not in a namespace enclosing 'N2'}} } struct X6 { @@ -147,5 +147,5 @@ namespace N2 { template struct X7<double>; // expected-warning{{must occur in namespace}} - template struct X9<float>; // expected-warning{{must occur in the global}} + template struct X9<float>; // expected-warning{{must occur at global scope}} } diff --git a/clang/test/SemaTemplate/temp_explicit_cxx0x.cpp b/clang/test/SemaTemplate/temp_explicit_cxx0x.cpp index 9d6dc80b5b0..e37fcd7c6a5 100644 --- a/clang/test/SemaTemplate/temp_explicit_cxx0x.cpp +++ b/clang/test/SemaTemplate/temp_explicit_cxx0x.cpp @@ -18,7 +18,7 @@ template struct ::N1::Inner::X1<float>; namespace N2 { using namespace N1; - template struct X0<double>; // expected-error{{not in a namespace enclosing}} + template struct X0<double>; // expected-error{{must occur in namespace 'N1'}} template struct X2<float>; // expected-error{{at global scope}} } |

