aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/class.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/class.cpp')
-rw-r--r--test/SemaCXX/class.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/test/SemaCXX/class.cpp b/test/SemaCXX/class.cpp
index 44fa0ce7ec9f..160f365f4bbf 100644
--- a/test/SemaCXX/class.cpp
+++ b/test/SemaCXX/class.cpp
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
class C {
public:
- auto int errx; // expected-error {{error: storage class specified for a member declaration}}
+ auto int errx; // expected-error {{error: storage class specified for a member declaration}} expected-warning {{'auto' storage class specifier is redundant}}
register int erry; // expected-error {{error: storage class specified for a member declaration}}
extern int errz; // expected-error {{error: storage class specified for a member declaration}}
@@ -34,11 +34,12 @@ public:
enum E1 { en1, en2 };
- int i = 0; // expected-warning {{in-class initialization of non-static data member accepted as a C++0x extension}}
+ int i = 0; // expected-warning {{in-class initialization of non-static data member accepted as a C++11 extension}}
static int si = 0; // expected-error {{non-const static data member must be initialized out of line}}
static const NestedC ci = 0; // expected-error {{static data member of type 'const C::NestedC' must be initialized out of line}}
static const int nci = vs; // expected-error {{in-class initializer is not a constant expression}}
static const int vi = 0;
+ static const volatile int cvi = 0; // ok, illegal in C++11
static const E evi = 0;
void m() {
@@ -172,8 +173,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' is a GNU extension}}
+ static const float y = foo(); // expected-warning {{in-class initializer for static data member of type 'const float' is a GNU extension}} expected-error {{in-class initializer is not a constant expression}}
};
}
@@ -188,3 +189,7 @@ void f() {
S::c; // expected-error {{invalid use of nonstatic data member}}
}
}
+
+struct PR9989 {
+ static int const PR9989_Member = sizeof PR9989_Member;
+};