aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/cxx0x-class.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-09-30 00:33:19 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-09-30 00:33:19 +0000
commit2d23ec29805f54edb3243022c64d752b8fbe5f46 (patch)
treeb9b586d997798ddb569da42873b5c0f9d9f7fba4 /test/SemaCXX/cxx0x-class.cpp
parent947be1941e9a1d4233116f51a45799d3904d4231 (diff)
Suggest adding 'constexpr' if the GNU extension for in-class initializers for static const float members is used in C++11 mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140828 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/cxx0x-class.cpp')
-rw-r--r--test/SemaCXX/cxx0x-class.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/SemaCXX/cxx0x-class.cpp b/test/SemaCXX/cxx0x-class.cpp
index bd857e07fe..5d12b83ccd 100644
--- a/test/SemaCXX/cxx0x-class.cpp
+++ b/test/SemaCXX/cxx0x-class.cpp
@@ -20,8 +20,8 @@ namespace rdar8367341 {
float foo();
struct A {
- static const float x = 5.0f; // expected-warning {{GNU extension}}
- static const float y = foo(); // expected-warning {{GNU extension}} expected-error {{in-class initializer is not a constant expression}}
+ static const float x = 5.0f; // expected-warning {{GNU extension}} expected-note {{use 'constexpr' specifier to silence this warning}}
+ static const float y = foo(); // expected-warning {{GNU extension}} expected-note {{use 'constexpr' specifier to silence this warning}} expected-error {{in-class initializer is not a constant expression}}
static constexpr float x2 = 5.0f;
static constexpr float y2 = foo(); // expected-error {{must be initialized by a constant expression}}
};