aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/class
diff options
context:
space:
mode:
Diffstat (limited to 'test/CXX/class')
-rw-r--r--test/CXX/class/class.bit/p2.cpp22
-rw-r--r--test/CXX/class/class.friend/p2.cpp2
-rw-r--r--test/CXX/class/class.friend/p6.cpp2
-rw-r--r--test/CXX/class/class.mem/p5-0x.cpp2
-rw-r--r--test/CXX/class/class.mem/p8-0x.cpp2
-rw-r--r--test/CXX/class/class.nest/p1-cxx0x.cpp2
-rw-r--r--test/CXX/class/class.static/class.static.data/p3.cpp26
-rw-r--r--test/CXX/class/p1-0x.cpp2
-rw-r--r--test/CXX/class/p2-0x.cpp2
-rw-r--r--test/CXX/class/p6-0x.cpp2
10 files changed, 56 insertions, 8 deletions
diff --git a/test/CXX/class/class.bit/p2.cpp b/test/CXX/class/class.bit/p2.cpp
new file mode 100644
index 000000000000..7962330d1612
--- /dev/null
+++ b/test/CXX/class/class.bit/p2.cpp
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+
+struct A {
+private:
+ int : 0;
+};
+
+A a = { };
+A a2 = { 1 }; // expected-error{{excess elements in struct initializer}}
+
+struct B {
+ const int : 0;
+};
+
+B b;
+
+void testB() {
+ B b2(b);
+ B b3(static_cast<B&&>(b2));
+ b = b;
+ b = static_cast<B&&>(b);
+}
diff --git a/test/CXX/class/class.friend/p2.cpp b/test/CXX/class/class.friend/p2.cpp
index 87b69c095fbd..fb3cd19b2b18 100644
--- a/test/CXX/class/class.friend/p2.cpp
+++ b/test/CXX/class/class.friend/p2.cpp
@@ -4,7 +4,7 @@ struct B0;
class A {
friend class B {}; // expected-error {{cannot define a type in a friend declaration}}
- friend int; // expected-warning {{non-class friend type 'int' is a C++0x extension}}
+ friend int; // expected-warning {{non-class friend type 'int' is a C++11 extension}}
friend B0; // expected-warning {{specify 'struct' to befriend 'B0'}}
friend class C; // okay
};
diff --git a/test/CXX/class/class.friend/p6.cpp b/test/CXX/class/class.friend/p6.cpp
index bd4630e2aa9d..82a90ff82f20 100644
--- a/test/CXX/class/class.friend/p6.cpp
+++ b/test/CXX/class/class.friend/p6.cpp
@@ -3,7 +3,7 @@
class A {
friend static class B; // expected-error {{'static' is invalid in friend declarations}}
friend extern class C; // expected-error {{'extern' is invalid in friend declarations}}
- friend auto class D; // expected-error {{'auto' is invalid in friend declarations}}
+ friend auto class D; // expected-warning {{incompatible with C++11}} expected-error {{'auto' is invalid in friend declarations}}
friend register class E; // expected-error {{'register' is invalid in friend declarations}}
friend mutable class F; // expected-error {{'mutable' is invalid in friend declarations}}
friend typedef class G; // expected-error {{'typedef' is invalid in friend declarations}}
diff --git a/test/CXX/class/class.mem/p5-0x.cpp b/test/CXX/class/class.mem/p5-0x.cpp
index 78560e2d5daa..6061c4c20a67 100644
--- a/test/CXX/class/class.mem/p5-0x.cpp
+++ b/test/CXX/class/class.mem/p5-0x.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
int f();
diff --git a/test/CXX/class/class.mem/p8-0x.cpp b/test/CXX/class/class.mem/p8-0x.cpp
index 836ebad48ee1..d2c3dc36075b 100644
--- a/test/CXX/class/class.mem/p8-0x.cpp
+++ b/test/CXX/class/class.mem/p8-0x.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c++0x -verify %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
struct Base1 {
virtual void g();
diff --git a/test/CXX/class/class.nest/p1-cxx0x.cpp b/test/CXX/class/class.nest/p1-cxx0x.cpp
index f8b06ac5f7e3..0f12579ee4f8 100644
--- a/test/CXX/class/class.nest/p1-cxx0x.cpp
+++ b/test/CXX/class/class.nest/p1-cxx0x.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c++0x -verify %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
class Outer {
int x;
diff --git a/test/CXX/class/class.static/class.static.data/p3.cpp b/test/CXX/class/class.static/class.static.data/p3.cpp
new file mode 100644
index 000000000000..007e416e6a49
--- /dev/null
+++ b/test/CXX/class/class.static/class.static.data/p3.cpp
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+
+struct NonLit {
+ NonLit();
+};
+
+struct S {
+ static constexpr int a = 0;
+ static constexpr int b; // expected-error {{declaration of constexpr variable 'b' requires an initializer}}
+
+ static constexpr int c = 0;
+ static const int d;
+ static const int d2 = 0;
+
+ static constexpr double e = 0.0; // ok
+ static const double f = 0.0; // expected-warning {{extension}} expected-note {{use 'constexpr' specifier}}
+ static char *const g = 0; // expected-error {{requires 'constexpr' specifier}}
+ static const NonLit h = NonLit(); // expected-error {{must be initialized out of line}}
+};
+
+constexpr int S::a;
+constexpr int S::b = 0;
+
+const int S::c;
+constexpr int S::d = 0;
+constexpr int S::d2;
diff --git a/test/CXX/class/p1-0x.cpp b/test/CXX/class/p1-0x.cpp
index e677dec4caf1..be5fdffb43f4 100644
--- a/test/CXX/class/p1-0x.cpp
+++ b/test/CXX/class/p1-0x.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x
+// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
namespace Test1 {
class A final { };
diff --git a/test/CXX/class/p2-0x.cpp b/test/CXX/class/p2-0x.cpp
index 630aa7e70f90..dbb01e5ad528 100644
--- a/test/CXX/class/p2-0x.cpp
+++ b/test/CXX/class/p2-0x.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x
+// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
namespace Test1 {
class A final { }; // expected-note {{'A' declared here}}
diff --git a/test/CXX/class/p6-0x.cpp b/test/CXX/class/p6-0x.cpp
index fc83e065fa6f..3384af09c788 100644
--- a/test/CXX/class/p6-0x.cpp
+++ b/test/CXX/class/p6-0x.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x
+// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
class Trivial { int n; void f(); };
class NonTrivial1 { NonTrivial1(const NonTrivial1 &); };