[llvm] r216244 - Add an explicit move constructor to SrcBuffer

Reid Kleckner reid at kleckner.net
Thu Aug 21 16:24:08 PDT 2014


Author: rnk
Date: Thu Aug 21 18:24:08 2014
New Revision: 216244

URL: http://llvm.org/viewvc/llvm-project?rev=216244&view=rev
Log:
Add an explicit move constructor to SrcBuffer

MSVC can't synthesize the explicit one.  Instead it tries to emit a copy
ctor which would call the deleted copy ctor of unique_ptr.

Modified:
    llvm/trunk/include/llvm/Support/SourceMgr.h

Modified: llvm/trunk/include/llvm/Support/SourceMgr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/SourceMgr.h?rev=216244&r1=216243&r2=216244&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/SourceMgr.h (original)
+++ llvm/trunk/include/llvm/Support/SourceMgr.h Thu Aug 21 18:24:08 2014
@@ -51,6 +51,11 @@ private:
 
     /// This is the location of the parent include, or null if at the top level.
     SMLoc IncludeLoc;
+
+    SrcBuffer() {}
+
+    SrcBuffer(SrcBuffer &&O)
+        : Buffer(std::move(O.Buffer)), IncludeLoc(O.IncludeLoc) {}
   };
 
   /// This is all of the buffers that we are reading from.





More information about the llvm-commits mailing list