summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/special/class.copy/p11.0x.copy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CXX/special/class.copy/p11.0x.copy.cpp')
-rw-r--r--clang/test/CXX/special/class.copy/p11.0x.copy.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/clang/test/CXX/special/class.copy/p11.0x.copy.cpp b/clang/test/CXX/special/class.copy/p11.0x.copy.cpp
index 1ca0143d093..a4d0cdcdc73 100644
--- a/clang/test/CXX/special/class.copy/p11.0x.copy.cpp
+++ b/clang/test/CXX/special/class.copy/p11.0x.copy.cpp
@@ -121,13 +121,22 @@ extern HasNoAccessDtorBase HNADBa;
HasNoAccessDtorBase HNADBb(HNADBa); // expected-error{{implicitly-deleted copy constructor}}
// -- a non-static data member of rvalue reference type
+int some_int;
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}}
+ int && ri = static_cast<int&&>(some_int); // expected-note{{copy constructor of 'RValue' is implicitly deleted because field 'ri' is of rvalue reference type 'int &&'}}
};
RValue RVa;
RValue RVb(RVa); // expected-error{{call to implicitly-deleted copy constructor}}
+// FIXME: The note on the class-name is attached to the location of the
+// constructor. This is not especially clear.
+struct RValueTmp { // expected-note {{used here}}
+ int && ri = 1; // expected-note{{copy constructor of 'RValueTmp' is implicitly deleted because field 'ri' is of rvalue reference type 'int &&'}}
+ // expected-error@-1 {{reference member 'ri' binds to a temporary}}
+};
+RValueTmp RVTa; // expected-note {{implicit default constructor for 'RValueTmp' first required here}}
+RValueTmp RVTb(RVTa); // expected-error{{call to implicitly-deleted copy constructor}}
+
namespace PR13381 {
struct S {
S(const S&);
OpenPOWER on IntegriCloud