diff options
Diffstat (limited to 'test/CXX/class.derived/class.abstract/p16.cpp')
-rw-r--r-- | test/CXX/class.derived/class.abstract/p16.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/CXX/class.derived/class.abstract/p16.cpp b/test/CXX/class.derived/class.abstract/p16.cpp index 93f905cd33..c237ed9044 100644 --- a/test/CXX/class.derived/class.abstract/p16.cpp +++ b/test/CXX/class.derived/class.abstract/p16.cpp @@ -14,3 +14,29 @@ struct C: A { virtual void a(); virtual void b() = delete; }; + +struct E; +struct F; +struct G; +struct H; +struct D { + virtual E &operator=(const E &); // expected-note {{here}} + virtual F &operator=(const F &); + virtual G &operator=(G&&); + virtual H &operator=(H&&); // expected-note {{here}} + friend struct F; + +private: + D &operator=(const D&) = default; + D &operator=(D&&) = default; + virtual ~D(); // expected-note 2{{here}} +}; +struct E : D {}; // expected-error {{deleted function '~E' cannot override a non-deleted function}} \ + // expected-error {{deleted function 'operator=' cannot override a non-deleted function}} +struct F : D {}; +// No move ctor here, because it would be deleted. +struct G : D {}; // expected-error {{deleted function '~G' cannot override a non-deleted function}} +struct H : D { + H &operator=(H&&) = default; // expected-error {{deleted function 'operator=' cannot override a non-deleted function}} + ~H(); +}; |