diff options
Diffstat (limited to 'clang/test/SemaCXX')
4 files changed, 8 insertions, 10 deletions
diff --git a/clang/test/SemaCXX/MicrosoftExtensions.cpp b/clang/test/SemaCXX/MicrosoftExtensions.cpp index c605dcb912f..55adb68d2e4 100644 --- a/clang/test/SemaCXX/MicrosoftExtensions.cpp +++ b/clang/test/SemaCXX/MicrosoftExtensions.cpp @@ -489,7 +489,6 @@ void AfterClassBody() { namespace PR24246 { template <typename TX> struct A { template <bool> struct largest_type_select; - // expected-warning@+1 {{explicit specialization of 'largest_type_select' within class scope is a Microsoft extension}} template <> struct largest_type_select<false> { blah x; // expected-error {{unknown type name 'blah'}} }; diff --git a/clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp b/clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp index 66f0f10f0f3..04c4429368f 100644 --- a/clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp +++ b/clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp @@ -15,8 +15,8 @@ class A { template<typename T> static CONST T right<T,int> = 5; template<typename T> CONST int right<int,T>; // expected-error {{member 'right' declared as a template}} template<typename T> CONST float right<float,T> = 5; // expected-error {{member 'right' declared as a template}} - template<> static CONST int right<int,int> = 7; // expected-error {{explicit specialization of 'right' in class scope}} - template<> static CONST float right<float,int>; // expected-error {{explicit specialization of 'right' in class scope}} + template<> static CONST int right<int,int> = 7; + template<> static CONST float right<float,int>; template static CONST int right<int,int>; // expected-error {{expected '<' after 'template'}} }; @@ -163,8 +163,8 @@ namespace constexpred { template<typename T> constexpr int right<int,T>; // expected-error {{member 'right' declared as a template}} \ // expected-error {{non-static data member cannot be constexpr; did you intend to make it const?}} template<typename T> constexpr float right<float,T> = 5; // expected-error {{non-static data member cannot be constexpr; did you intend to make it static?}} - template<> static constexpr int right<int,int> = 7; // expected-error {{explicit specialization of 'right' in class scope}} - template<> static constexpr float right<float,int>; // expected-error {{explicit specialization of 'right' in class scope}} + template<> static constexpr int right<int,int> = 7; + template<> static constexpr float right<float,int>; // expected-error {{requires an initializer}} template static constexpr int right<int,int>; // expected-error {{expected '<' after 'template'}} }; } diff --git a/clang/test/SemaCXX/cxx1y-variable-templates_top_level.cpp b/clang/test/SemaCXX/cxx1y-variable-templates_top_level.cpp index a78548b6f12..ecd9593c675 100644 --- a/clang/test/SemaCXX/cxx1y-variable-templates_top_level.cpp +++ b/clang/test/SemaCXX/cxx1y-variable-templates_top_level.cpp @@ -409,7 +409,7 @@ namespace nested { #endif float f1 = pi1a<float>; - template<> double pi1a<double> = 5.2; // expected-error {{variable template specialization of 'pi1a' must originally be declared in namespace 'n1'}} + template<> double pi1a<double> = 5.2; // expected-error {{not in a namespace enclosing 'n1'}} double d1 = pi1a<double>; } @@ -422,8 +422,7 @@ namespace nested { #endif float f1 = n1::pi1b<float>; - template<> double n1::pi1b<double> = 5.2; // expected-error {{cannot define or redeclare 'pi1b' here because namespace 'use_n1b' does not enclose namespace 'n1'}} \ - // expected-error {{variable template specialization of 'pi1b' must originally be declared in namespace 'n1'}} + template<> double n1::pi1b<double> = 5.2; // expected-error {{not in a namespace enclosing 'n1'}} double d1 = n1::pi1b<double>; } } diff --git a/clang/test/SemaCXX/cxx98-compat.cpp b/clang/test/SemaCXX/cxx98-compat.cpp index 4a9baf5100d..33516f70687 100644 --- a/clang/test/SemaCXX/cxx98-compat.cpp +++ b/clang/test/SemaCXX/cxx98-compat.cpp @@ -185,9 +185,9 @@ namespace RedundantParensInAddressTemplateParam { } namespace TemplateSpecOutOfScopeNs { - template<typename T> struct S {}; // expected-note {{here}} + template<typename T> struct S {}; } -template<> struct TemplateSpecOutOfScopeNs::S<char> {}; // expected-warning {{class template specialization of 'S' outside namespace 'TemplateSpecOutOfScopeNs' is incompatible with C++98}} +template<> struct TemplateSpecOutOfScopeNs::S<char> {}; struct Typename { template<typename T> struct Inner {}; |