diff options
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/SemaCXX/cxx0x-compat.cpp | 13 | ||||
| -rw-r--r-- | clang/test/SemaTemplate/temp_explicit.cpp | 6 | ||||
| -rw-r--r-- | clang/test/SemaTemplate/temp_explicit_cxx0x.cpp | 2 |
3 files changed, 12 insertions, 9 deletions
diff --git a/clang/test/SemaCXX/cxx0x-compat.cpp b/clang/test/SemaCXX/cxx0x-compat.cpp index a01b26c5f91..4a7c1defee0 100644 --- a/clang/test/SemaCXX/cxx0x-compat.cpp +++ b/clang/test/SemaCXX/cxx0x-compat.cpp @@ -1,18 +1,21 @@ // RUN: %clang_cc1 -fsyntax-only -std=c++98 -Wc++0x-compat -verify %s namespace N { - template<typename T> void f(T) {} // expected-note {{here}} + template<typename T> void f(T) {} // expected-note 2{{here}} namespace M { - template void f<int>(int); // expected-warning {{explicit instantiation of 'N::f' must occur in namespace 'N'}} + template void ::N::f<int>(int); // expected-warning {{explicit instantiation of 'f' not in a namespace enclosing 'N'}} } } +using namespace N; +template void f<char>(char); // expected-warning {{explicit instantiation of 'N::f' must occur in namespace 'N'}} -template<typename T> void f(T) {} // expected-note {{here}} +template<typename T> void g(T) {} // expected-note 2{{here}} namespace M { - template void f<int>(int); // expected-warning {{explicit instantiation of 'f' must occur in the global namespace}} + template void g<int>(int); // expected-warning {{explicit instantiation of 'g' must occur at global scope}} + template void ::g<char>(char); // expected-warning {{explicit instantiation of 'g' must occur at global scope}} } -void f() { +void g() { auto int n = 0; // expected-warning {{'auto' storage class specifier is redundant and incompatible with C++11}} } 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}} } |

