diff options
Diffstat (limited to 'test/SemaTemplate/instantiate-static-var.cpp')
-rw-r--r-- | test/SemaTemplate/instantiate-static-var.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/SemaTemplate/instantiate-static-var.cpp b/test/SemaTemplate/instantiate-static-var.cpp index a7b3433..648ee41 100644 --- a/test/SemaTemplate/instantiate-static-var.cpp +++ b/test/SemaTemplate/instantiate-static-var.cpp @@ -1,4 +1,7 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s + template<typename T, T Divisor> class X { public: @@ -11,7 +14,13 @@ X<int, 0> xi0; // expected-note{{in instantiation of template class 'X<int, 0>' template<typename T> class Y { - static const T value = 0; // expected-warning{{in-class initializer for static data member of type 'const float' is a GNU extension}} + static const T value = 0; +#if __cplusplus <= 199711L +// expected-warning@-2 {{in-class initializer for static data member of type 'const float' is a GNU extension}} +#else +// expected-error@-4 {{in-class initializer for static data member of type 'const float' requires 'constexpr' specifier}} +// expected-note@-5 {{add 'constexpr'}} +#endif }; Y<float> fy; // expected-note{{in instantiation of template class 'Y<float>' requested here}} |