diff options
author | John McCall <rjmccall@apple.com> | 2010-09-10 23:21:22 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-09-10 23:21:22 +0000 |
commit | db76892e72e458030804b9d6d9e2eea16d52f229 (patch) | |
tree | 2db0059dbf234b610cf64617ed4daee2299eb444 /clang/test/SemaTemplate/instantiate-static-var.cpp | |
parent | 72497e5d90807a40eb4d8d311e9e0c0e011c6e4c (diff) | |
download | bcm5719-llvm-db76892e72e458030804b9d6d9e2eea16d52f229.tar.gz bcm5719-llvm-db76892e72e458030804b9d6d9e2eea16d52f229.zip |
Support in-class initialization of static const floating-point data members.
llvm-svn: 113663
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-static-var.cpp')
-rw-r--r-- | clang/test/SemaTemplate/instantiate-static-var.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/SemaTemplate/instantiate-static-var.cpp b/clang/test/SemaTemplate/instantiate-static-var.cpp index e90ac5223d9..cd25ccb3d31 100644 --- a/clang/test/SemaTemplate/instantiate-static-var.cpp +++ b/clang/test/SemaTemplate/instantiate-static-var.cpp @@ -2,7 +2,7 @@ template<typename T, T Divisor> class X { public: - static const T value = 10 / Divisor; // expected-error{{in-class initializer is not an integral constant expression}} + static const T value = 10 / Divisor; // expected-error{{in-class initializer is not a constant expression}} }; int array1[X<int, 2>::value == 5? 1 : -1]; @@ -11,7 +11,7 @@ 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-error{{'value' can only be initialized if it is a static const integral data member}} + static const T value = 0; // expected-warning{{in-class initializer for static data member of type 'float const' is a C++0x extension}} }; Y<float> fy; // expected-note{{in instantiation of template class 'Y<float>' requested here}} |