]> granicus.if.org Git - clang/commitdiff
Preventing future MSVC 2012 surprises with SimpleArray by giving it an explicit move...
authorAaron Ballman <aaron@aaronballman.com>
Thu, 17 Apr 2014 12:50:54 +0000 (12:50 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Thu, 17 Apr 2014 12:50:54 +0000 (12:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206460 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/Analyses/ThreadSafetyUtil.h

index c8e670b98d7b554a861fe160e4c4e8c4f149e855..4ca49dfbd99192394f173237523c8e2f4d5693f4 100644 (file)
@@ -88,6 +88,18 @@ public:
     A.Capacity = 0;
   }
 
+  SimpleArray &operator=(SimpleArray &&RHS) {
+    if (this != &RHS) {
+      Data = RHS.Data;
+      Size = RHS.Size;
+      Capacity = RHS.Capacity;
+
+      RHS.Data = nullptr;
+      RHS.Size = RHS.Capacity = 0;
+    }
+    return *this;
+  }
+
   T *resize(size_t Ncp, MemRegionRef A) {
     T *Odata = Data;
     Data = A.allocateT<T>(Ncp);