summaryrefslogtreecommitdiffstats
path: root/include/clang/Parse/Ownership.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Parse/Ownership.h')
-rw-r--r--include/clang/Parse/Ownership.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/include/clang/Parse/Ownership.h b/include/clang/Parse/Ownership.h
index 5eb9635..e9a20b7 100644
--- a/include/clang/Parse/Ownership.h
+++ b/include/clang/Parse/Ownership.h
@@ -166,7 +166,7 @@ namespace llvm {
// conversions.
// Flip this switch to measure performance impact of the smart pointers.
-//#define DISABLE_SMART_POINTERS
+// #define DISABLE_SMART_POINTERS
namespace llvm {
template<>
@@ -403,8 +403,10 @@ namespace clang {
friend class moving::ASTResultMover<Destroyer>;
+#if !(defined(_MSC_VER) && _MSC_VER >= 1600)
ASTOwningResult(ASTOwningResult&); // DO NOT IMPLEMENT
ASTOwningResult& operator =(ASTOwningResult&); // DO NOT IMPLEMENT
+#endif
void destroy() {
if (Ptr) {
@@ -444,6 +446,19 @@ namespace clang {
return *this;
}
+#if defined(_MSC_VER) && _MSC_VER >= 1600
+ // Emulated move semantics don't work with msvc.
+ ASTOwningResult(ASTOwningResult &&mover)
+ : ActionInv(mover.ActionInv),
+ Ptr(mover.Ptr) {
+ mover.Ptr = 0;
+ }
+ ASTOwningResult &operator=(ASTOwningResult &&mover) {
+ *this = moving::ASTResultMover<Destroyer>(mover);
+ return *this;
+ }
+#endif
+
/// Assignment from a raw pointer. Takes ownership - beware!
ASTOwningResult &operator=(void *raw) {
destroy();
OpenPOWER on IntegriCloud