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 | 19 |
1 files changed, 19 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 a334c50e9fda..1ca0143d0930 100644 --- a/test/CXX/special/class.copy/p11.0x.copy.cpp +++ b/test/CXX/special/class.copy/p11.0x.copy.cpp @@ -139,3 +139,22 @@ namespace PR13381 { T &f(); T t = f(); // expected-error{{call to implicitly-deleted copy constructor}} } + +namespace Mutable { + struct A { + A(const A &); + A(A &) = delete; // expected-note {{deleted here}} + }; + + struct B { + A a; + B(const B &); + }; + B::B(const B &) = default; + + struct C { + mutable A a; // expected-note {{deleted because field 'a' has a deleted copy constructor}} + C(const C &); + }; + C::C(const C &) = default; // expected-error{{would delete}} +} |