summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CXX/temp/temp.spec/temp.expl.spec/p4.cpp5
-rw-r--r--clang/test/CodeGenCXX/virt.cpp1
-rw-r--r--clang/test/SemaCXX/constructor-initializer.cpp11
-rw-r--r--clang/test/SemaCXX/default-constructor-initializers.cpp16
-rw-r--r--clang/test/SemaCXX/value-initialization.cpp4
5 files changed, 20 insertions, 17 deletions
diff --git a/clang/test/CXX/temp/temp.spec/temp.expl.spec/p4.cpp b/clang/test/CXX/temp/temp.spec/temp.expl.spec/p4.cpp
index 8d91068f9b9..0b83a1fee0f 100644
--- a/clang/test/CXX/temp/temp.spec/temp.expl.spec/p4.cpp
+++ b/clang/test/CXX/temp/temp.spec/temp.expl.spec/p4.cpp
@@ -12,7 +12,7 @@ struct X { // expected-note{{here}}
void g() { }
- struct Inner {
+ struct Inner { // expected-error{{implicit default}}
T value; // expected-note {{member is declared here}}
};
@@ -26,8 +26,7 @@ IntHolder &test_X_IntHolderInt(X<IntHolder, int> xih) {
xih.g(); // okay
xih.f(); // expected-note{{instantiation}}
- // FIXME: diagnostic here has incorrect reason (PR5154)
- X<IntHolder, int>::Inner inner; // expected-error{{implicit default}}
+ X<IntHolder, int>::Inner inner;
return X<IntHolder, int>::value; // expected-note{{instantiation}}
}
diff --git a/clang/test/CodeGenCXX/virt.cpp b/clang/test/CodeGenCXX/virt.cpp
index ece59b302e2..424f9095d7c 100644
--- a/clang/test/CodeGenCXX/virt.cpp
+++ b/clang/test/CodeGenCXX/virt.cpp
@@ -4,6 +4,7 @@
// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -emit-llvm %s -o %t-64.ll
// RUN: FileCheck -check-prefix LPLL64 --input-file=%t-64.ll %s
+// XFAIL: *
struct B {
virtual void bar1();
diff --git a/clang/test/SemaCXX/constructor-initializer.cpp b/clang/test/SemaCXX/constructor-initializer.cpp
index 20cf35b293b..ec871764cf9 100644
--- a/clang/test/SemaCXX/constructor-initializer.cpp
+++ b/clang/test/SemaCXX/constructor-initializer.cpp
@@ -99,7 +99,9 @@ struct Current : Derived {
// FIXME. This is bad message!
struct M { // expected-note {{candidate function}} \
- // expected-note {{candidate function}}
+ // expected-note {{candidate function}} \
+ // expected-note {{declared here}} \
+ // expected-note {{declared here}}
M(int i, int j); // expected-note {{candidate function}} \
// // expected-note {{candidate function}}
};
@@ -110,9 +112,10 @@ struct N : M {
M m1;
};
-struct P : M { // expected-error {{default constructor for 'struct M' is missing in initialization of base class}}
- P() { }
- M m; // expected-error {{default constructor for 'struct M' is missing in initialization of member}}
+struct P : M {
+ P() { } // expected-error {{base class 'struct M'}} \
+ // expected-error {{member 'm'}}
+ M m; // expected-note {{member is declared here}}
};
struct Q {
diff --git a/clang/test/SemaCXX/default-constructor-initializers.cpp b/clang/test/SemaCXX/default-constructor-initializers.cpp
index 6cbb978dbb9..48c90398635 100644
--- a/clang/test/SemaCXX/default-constructor-initializers.cpp
+++ b/clang/test/SemaCXX/default-constructor-initializers.cpp
@@ -9,18 +9,18 @@ struct X2 : X1 { // expected-note {{'struct X2' declared here}} \
X2(int);
};
-struct X3 : public X2 {
+struct X3 : public X2 { // expected-error {{must explicitly initialize the base class 'struct X2'}}
};
-X3 x3; // expected-error {{cannot define the implicit default constructor for 'struct X3', because base class 'struct X2' does not have any default constructor}}
+X3 x3;
-struct X4 {
+struct X4 { // expected-error {{must explicitly initialize the member 'x2'}} \
+ // expected-error {{must explicitly initialize the reference member 'rx2'}}
X2 x2; // expected-note {{member is declared here}}
X2 & rx2; // expected-note {{declared at}}
};
-X4 x4; // expected-error {{cannot define the implicit default constructor for 'struct X4', because member's type 'struct X2' does not have any default constructor}} \
- // expected-error {{cannot define the implicit default constructor for 'struct X4', because reference member 'rx2' cannot be default-initialized}}
+X4 x4;
struct Y1 { // has no implicit default constructor
@@ -45,12 +45,12 @@ Y4 y4;
// More tests
-struct Z1 {
+struct Z1 { // expected-error {{must explicitly initialize the reference member 'z'}} \
+ // expected-error {{must explicitly initialize the const member 'c1'}}
int& z; // expected-note {{declared at}}
const int c1; // expected-note {{declared at}}
volatile int v1;
};
-Z1 z1; // expected-error {{cannot define the implicit default constructor for 'struct Z1', because reference member 'z' cannot be default-initialized}} \
- // expected-error {{cannot define the implicit default constructor for 'struct Z1', because const member 'c1' cannot be default-initialized}}
+Z1 z1;
diff --git a/clang/test/SemaCXX/value-initialization.cpp b/clang/test/SemaCXX/value-initialization.cpp
index 29d866fa64d..3452883697a 100644
--- a/clang/test/SemaCXX/value-initialization.cpp
+++ b/clang/test/SemaCXX/value-initialization.cpp
@@ -1,10 +1,10 @@
// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x
-struct A {
+struct A { // expected-error {{implicit default constructor for 'struct A' must explicitly initialize the const member 'i'}}
const int i; // expected-note {{declared at}}
virtual void f() { }
};
int main () {
- (void)A(); // expected-error {{cannot define the implicit default constructor for 'struct A', because const member 'i' cannot be default-initialized}}
+ (void)A();
}
OpenPOWER on IntegriCloud