summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/MicrosoftCompatibility.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-11-19 00:30:56 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-11-19 00:30:56 +0000
commit66bfcb3ea59437b83a15cfe47413b7dc3c9714ee (patch)
treeba4960d3efee5c70b8da8396441983d4064175dc /clang/test/SemaCXX/MicrosoftCompatibility.cpp
parentf7d563c76c40acc361417ec1bdef6f15739516e4 (diff)
downloadbcm5719-llvm-66bfcb3ea59437b83a15cfe47413b7dc3c9714ee.tar.gz
bcm5719-llvm-66bfcb3ea59437b83a15cfe47413b7dc3c9714ee.zip
Sema: As of MSVC 2015, a user-declared move operation causes the deletion of both copy operations.
Differential Revision: https://reviews.llvm.org/D26868 llvm-svn: 287411
Diffstat (limited to 'clang/test/SemaCXX/MicrosoftCompatibility.cpp')
-rw-r--r--clang/test/SemaCXX/MicrosoftCompatibility.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/MicrosoftCompatibility.cpp b/clang/test/SemaCXX/MicrosoftCompatibility.cpp
index 56608681088..26cd7825ee8 100644
--- a/clang/test/SemaCXX/MicrosoftCompatibility.cpp
+++ b/clang/test/SemaCXX/MicrosoftCompatibility.cpp
@@ -99,23 +99,39 @@ int jump_over_indirect_goto() {
namespace PR11826 {
struct pair {
pair(int v) { }
+#if _MSC_VER >= 1900
+ void operator=(pair&& rhs) { } // expected-note {{copy constructor is implicitly deleted because 'pair' has a user-declared move assignment operator}}
+#else
void operator=(pair&& rhs) { }
+#endif
};
void f() {
pair p0(3);
+#if _MSC_VER >= 1900
+ pair p = p0; // expected-error {{call to implicitly-deleted copy constructor of 'PR11826::pair'}}
+#else
pair p = p0;
+#endif
}
}
namespace PR11826_for_symmetry {
struct pair {
pair(int v) { }
+#if _MSC_VER >= 1900
+ pair(pair&& rhs) { } // expected-note {{copy assignment operator is implicitly deleted because 'pair' has a user-declared move constructor}}
+#else
pair(pair&& rhs) { }
+#endif
};
void f() {
pair p0(3);
pair p(4);
+#if _MSC_VER >= 1900
+ p = p0; // expected-error {{object of type 'PR11826_for_symmetry::pair' cannot be assigned because its copy assignment operator is implicitly deleted}}
+#else
p = p0;
+#endif
}
}
OpenPOWER on IntegriCloud