r204009 - The year is 2014. MSVC is still unable to synthesize move ctors.

Benjamin Kramer benny.kra at googlemail.com
Sat Mar 15 10:35:03 PDT 2014


Author: d0k
Date: Sat Mar 15 12:35:02 2014
New Revision: 204009

URL: http://llvm.org/viewvc/llvm-project?rev=204009&view=rev
Log:
The year is 2014. MSVC is still unable to synthesize move ctors.

Work around with a ton of boilerplate.

Modified:
    cfe/trunk/include/clang/Lex/Preprocessor.h

Modified: cfe/trunk/include/clang/Lex/Preprocessor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Preprocessor.h?rev=204009&r1=204008&r2=204009&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/Preprocessor.h (original)
+++ cfe/trunk/include/clang/Lex/Preprocessor.h Sat Mar 15 12:35:02 2014
@@ -305,6 +305,29 @@ class Preprocessor : public RefCountedBa
     PreprocessorLexer          *ThePPLexer;
     std::unique_ptr<TokenLexer> TheTokenLexer;
     const DirectoryLookup      *TheDirLookup;
+
+    // The following constructors are completely useless copies of the default
+    // versions, only needed to pacify MSVC.
+    IncludeStackInfo(enum CurLexerKind CurLexerKind, Module *TheSubmodule,
+                     std::unique_ptr<Lexer> &&TheLexer,
+                     std::unique_ptr<PTHLexer> &&ThePTHLexer,
+                     PreprocessorLexer *ThePPLexer,
+                     std::unique_ptr<TokenLexer> &&TheTokenLexer,
+                     const DirectoryLookup *TheDirLookup)
+        : CurLexerKind(std::move(CurLexerKind)),
+          TheSubmodule(std::move(TheSubmodule)), TheLexer(std::move(TheLexer)),
+          ThePTHLexer(std::move(ThePTHLexer)),
+          ThePPLexer(std::move(ThePPLexer)),
+          TheTokenLexer(std::move(TheTokenLexer)),
+          TheDirLookup(std::move(TheDirLookup)) {}
+    IncludeStackInfo(IncludeStackInfo &&RHS)
+        : CurLexerKind(std::move(RHS.CurLexerKind)),
+          TheSubmodule(std::move(RHS.TheSubmodule)),
+          TheLexer(std::move(RHS.TheLexer)),
+          ThePTHLexer(std::move(RHS.ThePTHLexer)),
+          ThePPLexer(std::move(RHS.ThePPLexer)),
+          TheTokenLexer(std::move(RHS.TheTokenLexer)),
+          TheDirLookup(std::move(RHS.TheDirLookup)) {}
   };
   std::vector<IncludeStackInfo> IncludeMacroStack;
 
@@ -1321,11 +1344,9 @@ public:
 private:
 
   void PushIncludeMacroStack() {
-    IncludeStackInfo Info = {CurLexerKind,        CurSubmodule,
-                             std::move(CurLexer), std::move(CurPTHLexer),
-                             CurPPLexer,          std::move(CurTokenLexer),
-                             CurDirLookup};
-    IncludeMacroStack.push_back(std::move(Info));
+    IncludeMacroStack.push_back(IncludeStackInfo(
+        CurLexerKind, CurSubmodule, std::move(CurLexer), std::move(CurPTHLexer),
+        CurPPLexer, std::move(CurTokenLexer), CurDirLookup));
     CurPPLexer = 0;
   }
 





More information about the cfe-commits mailing list