summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/special/class.dtor/p5-0x.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CXX/special/class.dtor/p5-0x.cpp')
-rw-r--r--clang/test/CXX/special/class.dtor/p5-0x.cpp55
1 files changed, 28 insertions, 27 deletions
diff --git a/clang/test/CXX/special/class.dtor/p5-0x.cpp b/clang/test/CXX/special/class.dtor/p5-0x.cpp
index cb7038aa9c4..19aa1190647 100644
--- a/clang/test/CXX/special/class.dtor/p5-0x.cpp
+++ b/clang/test/CXX/special/class.dtor/p5-0x.cpp
@@ -4,7 +4,7 @@ struct NonTrivDtor {
~NonTrivDtor();
};
struct DeletedDtor {
- ~DeletedDtor() = delete;
+ ~DeletedDtor() = delete; // expected-note 5 {{deleted here}}
};
class InaccessibleDtor {
~InaccessibleDtor() = default;
@@ -14,73 +14,74 @@ class InaccessibleDtor {
// -- X is a union-like class that has a variant member with a non-trivial
// destructor.
-union A1 { // expected-note {{here}}
+union A1 {
A1();
- NonTrivDtor n;
+ NonTrivDtor n; // expected-note {{destructor of union 'A1' is implicitly deleted because field 'n' has a non-trivial destructor}}
};
A1 a1; // expected-error {{deleted function}}
-struct A2 { // expected-note {{here}}
+struct A2 {
A2();
union {
- NonTrivDtor n;
+ NonTrivDtor n; // expected-note {{because field 'n' has a non-trivial destructor}}
};
};
A2 a2; // expected-error {{deleted function}}
-union A3 { // expected-note {{here}}
+union A3 {
A3();
- NonTrivDtor n[3];
+ NonTrivDtor n[3]; // expected-note {{because field 'n' has a non-trivial destructor}}
};
A3 a3; // expected-error {{deleted function}}
-struct A4 { // expected-note {{here}}
+struct A4 {
A4();
union {
- NonTrivDtor n[3];
+ NonTrivDtor n[3]; // expected-note {{because field 'n' has a non-trivial destructor}}
};
};
A4 a4; // expected-error {{deleted function}}
// -- any of the non-static data members has class type M (or array thereof) and
// M has a deleted or inaccessible destructor.
-struct B1 { // expected-note {{here}}
+struct B1 {
B1();
- DeletedDtor a;
+ DeletedDtor a; // expected-note {{because field 'a' has a deleted destructor}}
};
B1 b1; // expected-error {{deleted function}}
-struct B2 { // expected-note {{here}}
+struct B2 {
B2();
- InaccessibleDtor a;
+ InaccessibleDtor a; // expected-note {{because field 'a' has an inaccessible destructor}}
};
B2 b2; // expected-error {{deleted function}}
-struct B3 { // expected-note {{here}}
+struct B3 {
B3();
- DeletedDtor a[4];
+ DeletedDtor a[4]; // expected-note {{because field 'a' has a deleted destructor}}
};
B3 b3; // expected-error {{deleted function}}
-struct B4 { // expected-note {{here}}
+struct B4 {
B4();
- InaccessibleDtor a[4];
+ InaccessibleDtor a[4]; // expected-note {{because field 'a' has an inaccessible destructor}}
};
B4 b4; // expected-error {{deleted function}}
-union B5 { // expected-note {{here}}
+union B5 {
B5();
- union {
- DeletedDtor a;
+ // FIXME: Describe the anonymous union member better than ''.
+ union { // expected-note {{because field '' has a deleted destructor}}
+ DeletedDtor a; // expected-note {{because field 'a' has a deleted destructor}}
};
};
B5 b5; // expected-error {{deleted function}}
-union B6 { // expected-note {{here}}
+union B6 {
B6();
- union {
- InaccessibleDtor a;
+ union { // expected-note {{because field '' has a deleted destructor}}
+ InaccessibleDtor a; // expected-note {{because field 'a' has an inaccessible destructor}}
};
};
B6 b6; // expected-error {{deleted function}}
// -- any direct or virtual base class has a deleted or inaccessible destructor.
-struct C1 : DeletedDtor { C1(); } c1; // expected-error {{deleted function}} expected-note {{here}}
-struct C2 : InaccessibleDtor { C2(); } c2; // expected-error {{deleted function}} expected-note {{here}}
-struct C3 : virtual DeletedDtor { C3(); } c3; // expected-error {{deleted function}} expected-note {{here}}
-struct C4 : virtual InaccessibleDtor { C4(); } c4; // expected-error {{deleted function}} expected-note {{here}}
+struct C1 : DeletedDtor { C1(); } c1; // expected-error {{deleted function}} expected-note {{base class 'DeletedDtor' has a deleted destructor}}
+struct C2 : InaccessibleDtor { C2(); } c2; // expected-error {{deleted function}} expected-note {{base class 'InaccessibleDtor' has an inaccessible destructor}}
+struct C3 : virtual DeletedDtor { C3(); } c3; // expected-error {{deleted function}} expected-note {{base class 'DeletedDtor' has a deleted destructor}}
+struct C4 : virtual InaccessibleDtor { C4(); } c4; // expected-error {{deleted function}} expected-note {{base class 'InaccessibleDtor' has an inaccessible destructor}}
// -- for a virtual destructor, lookup of the non-array deallocation function
// results in an ambiguity or a function that is deleted or inaccessible.
OpenPOWER on IntegriCloud