summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/class.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-09-29 19:11:37 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-09-29 19:11:37 +0000
commit2316cd8b798be3163878e7397ec68a8890063098 (patch)
treee89a2675b03c27b64defcc69ac004ff8d0ef6329 /clang/test/SemaCXX/class.cpp
parentd71061298cc290668b9640a6a15456ea9b3a937c (diff)
downloadbcm5719-llvm-2316cd8b798be3163878e7397ec68a8890063098.tar.gz
bcm5719-llvm-2316cd8b798be3163878e7397ec68a8890063098.zip
constexpr: semantic checking for constexpr variables.
We had an extension which allowed const static class members of floating-point type to have in-class initializers, 'as a C++0x extension'. However, C++0x does not allow this. The extension has been kept, and extended to all literal types in C++0x mode (with a fixit to add the 'constexpr' specifier). llvm-svn: 140801
Diffstat (limited to 'clang/test/SemaCXX/class.cpp')
-rw-r--r--clang/test/SemaCXX/class.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/class.cpp b/clang/test/SemaCXX/class.cpp
index fd2d0b388a7..4071d1fdbb5 100644
--- a/clang/test/SemaCXX/class.cpp
+++ b/clang/test/SemaCXX/class.cpp
@@ -172,8 +172,8 @@ namespace rdar8367341 {
float foo();
struct A {
- static const float x = 5.0f; // expected-warning {{in-class initializer for static data member of type 'const float' is a C++0x extension}}
- static const float y = foo(); // expected-warning {{in-class initializer for static data member of type 'const float' is a C++0x extension}} expected-error {{in-class initializer is not a constant expression}}
+ static const float x = 5.0f; // expected-warning {{in-class initializer for static data member of type 'const float' not allowed}}
+ static const float y = foo(); // expected-warning {{in-class initializer for static data member of type 'const float' not allowed}} expected-error {{in-class initializer is not a constant expression}}
};
}
OpenPOWER on IntegriCloud