diff options
Diffstat (limited to 'test/CXX/special/class.copy/p11.0x.copy.cpp')
-rw-r--r-- | test/CXX/special/class.copy/p11.0x.copy.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/CXX/special/class.copy/p11.0x.copy.cpp b/test/CXX/special/class.copy/p11.0x.copy.cpp index fab3b9d..a334c50 100644 --- a/test/CXX/special/class.copy/p11.0x.copy.cpp +++ b/test/CXX/special/class.copy/p11.0x.copy.cpp @@ -1,5 +1,6 @@ // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s +struct Trivial {}; struct NonTrivial { NonTrivial(const NonTrivial&); }; @@ -69,6 +70,12 @@ struct Deleted { Deleted Da; Deleted Db(Da); // expected-error{{call to implicitly-deleted copy constructor}} +// It's implied (but not stated) that this also applies in the case where +// overload resolution would fail. +struct VolatileMember { + volatile Trivial vm; // expected-note {{has no copy}} +} vm1, vm2(vm1); // expected-error {{deleted}} + // -- a direct or virtual base class B that cannot be copied because overload // resolution results in an ambiguity or a function that is deleted or // inaccessible @@ -116,6 +123,7 @@ HasNoAccessDtorBase HNADBb(HNADBa); // expected-error{{implicitly-deleted copy c // -- a non-static data member of rvalue reference type struct RValue { int && ri = 1; // expected-note{{copy constructor of 'RValue' is implicitly deleted because field 'ri' is of rvalue reference type 'int &&'}} + // expected-warning@-1{{binding reference member 'ri' to a temporary}} expected-note@-1 {{here}} }; RValue RVa; RValue RVb(RVa); // expected-error{{call to implicitly-deleted copy constructor}} |