diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-02 20:59:25 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-02 20:59:25 +0000 |
commit | 5bdaac5454d93d1dcdc2319818497b685be56fcf (patch) | |
tree | fbf67c57fa5cdd443d079a9f6f149baf2535f57a /test/CXX | |
parent | 460ef136eb96b879f149c8703938a13c35b4bc68 (diff) |
Finish PR10217: Ensure we say that a special member was implicitly, not
explicitly, deleted in all relevant cases, and explain why.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153894 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX')
-rw-r--r-- | test/CXX/special/class.copy/implicit-move.cpp | 4 | ||||
-rw-r--r-- | test/CXX/special/class.ctor/p5-0x.cpp | 8 | ||||
-rw-r--r-- | test/CXX/special/class.dtor/p5-0x.cpp | 10 |
3 files changed, 10 insertions, 12 deletions
diff --git a/test/CXX/special/class.copy/implicit-move.cpp b/test/CXX/special/class.copy/implicit-move.cpp index 9cb4215cd0..7c69dd8b87 100644 --- a/test/CXX/special/class.copy/implicit-move.cpp +++ b/test/CXX/special/class.copy/implicit-move.cpp @@ -25,10 +25,10 @@ struct HasCopyAssignment { HasCopyAssignment & operator =(const HasCopyAssignment &) noexcept(false); }; -struct HasMoveConstructor { // expected-note {{implicit copy assignment}} +struct HasMoveConstructor { ThrowingCopy tc; HasMoveConstructor() noexcept; - HasMoveConstructor(HasMoveConstructor &&) noexcept; + HasMoveConstructor(HasMoveConstructor &&) noexcept; // expected-note {{deleted because 'HasMoveConstructor' has a user-declared move constructor}} }; struct HasMoveAssignment { // expected-note {{implicit copy constructor}} diff --git a/test/CXX/special/class.ctor/p5-0x.cpp b/test/CXX/special/class.ctor/p5-0x.cpp index ceb47d8f3b..694ab5b175 100644 --- a/test/CXX/special/class.ctor/p5-0x.cpp +++ b/test/CXX/special/class.ctor/p5-0x.cpp @@ -31,11 +31,9 @@ NotDeleted1b nd1b; // - any non-static data member with no brace-or-equal-initializer is of // reference type, class Deleted2a { - // FIXME: We should explain that the function was implicitly deleted as a - // result of being defaulted, and why. - Deleted2a() = default; // expected-note 4{{explicitly marked deleted here}} - int &a; -}; + Deleted2a() = default; // expected-note 4{{implicitly deleted here}} + int &a; // expected-note 4{{because field 'a' of reference type 'int &' would not be initialized}} +}; Deleted2a d2a; // expected-error {{implicitly-deleted default constructor}} struct Deleted2b { int &&b; // expected-note {{default constructor of 'Deleted2b' is implicitly deleted because field 'b' of reference type 'int &&' would not be initialized}} diff --git a/test/CXX/special/class.dtor/p5-0x.cpp b/test/CXX/special/class.dtor/p5-0x.cpp index 19aa119064..dbfa004440 100644 --- a/test/CXX/special/class.dtor/p5-0x.cpp +++ b/test/CXX/special/class.dtor/p5-0x.cpp @@ -90,15 +90,15 @@ class D1 { public: virtual ~D1() = default; } d1; // ok -struct D2 : D1 { // expected-note {{deleted here}} +struct D2 : D1 { // expected-note {{virtual destructor requires an unambiguous, accessible 'operator delete'}} // implicitly-virtual destructor } d2; // expected-error {{deleted function}} -struct D3 { - virtual ~D3() = default; // expected-note {{deleted here}} +struct D3 { // expected-note {{virtual destructor requires an unambiguous, accessible 'operator delete'}} + virtual ~D3() = default; // expected-note {{explicitly defaulted function was implicitly deleted here}} void operator delete(void*, double = 0.0); void operator delete(void*, char = 0); } d3; // expected-error {{deleted function}} -struct D4 { - virtual ~D4() = default; // expected-note {{deleted here}} +struct D4 { // expected-note {{virtual destructor requires an unambiguous, accessible 'operator delete'}} + virtual ~D4() = default; // expected-note {{implicitly deleted here}} void operator delete(void*) = delete; } d4; // expected-error {{deleted function}} |