r206460 - Preventing future MSVC 2012 surprises with SimpleArray by giving it an explicit move assignment operator.

Aaron Ballman aaron at aaronballman.com
Thu Apr 17 05:50:54 PDT 2014


Author: aaronballman
Date: Thu Apr 17 07:50:54 2014
New Revision: 206460

URL: http://llvm.org/viewvc/llvm-project?rev=206460&view=rev
Log:
Preventing future MSVC 2012 surprises with SimpleArray by giving it an explicit move assignment operator.

Modified:
    cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyUtil.h

Modified: cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyUtil.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyUtil.h?rev=206460&r1=206459&r2=206460&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyUtil.h (original)
+++ cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyUtil.h Thu Apr 17 07:50:54 2014
@@ -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);





More information about the cfe-commits mailing list