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

Work around with a ton of boilerplate.

llvm-svn: 204009
This commit is contained in:
Benjamin Kramer 2014-03-15 17:35:02 +00:00
parent 62fb0cfb97
commit 4f938ef1d8
1 changed files with 26 additions and 5 deletions

View File

@ -305,6 +305,29 @@ class Preprocessor : public RefCountedBase<Preprocessor> {
PreprocessorLexer *ThePPLexer; PreprocessorLexer *ThePPLexer;
std::unique_ptr<TokenLexer> TheTokenLexer; std::unique_ptr<TokenLexer> TheTokenLexer;
const DirectoryLookup *TheDirLookup; 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; std::vector<IncludeStackInfo> IncludeMacroStack;
@ -1321,11 +1344,9 @@ public:
private: private:
void PushIncludeMacroStack() { void PushIncludeMacroStack() {
IncludeStackInfo Info = {CurLexerKind, CurSubmodule, IncludeMacroStack.push_back(IncludeStackInfo(
std::move(CurLexer), std::move(CurPTHLexer), CurLexerKind, CurSubmodule, std::move(CurLexer), std::move(CurPTHLexer),
CurPPLexer, std::move(CurTokenLexer), CurPPLexer, std::move(CurTokenLexer), CurDirLookup));
CurDirLookup};
IncludeMacroStack.push_back(std::move(Info));
CurPPLexer = 0; CurPPLexer = 0;
} }