From: Richard Smith Date: Mon, 12 Sep 2016 06:38:31 +0000 (+0000) Subject: Attempt #3 to placate MSVC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4d206e7dc236dc6d22d2f6017701b42ef4cac59e;p=clang Attempt #3 to placate MSVC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281197 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/TableGen/ClangDiagnosticsEmitter.cpp b/utils/TableGen/ClangDiagnosticsEmitter.cpp index 2f16261d76..22e51572b9 100644 --- a/utils/TableGen/ClangDiagnosticsEmitter.cpp +++ b/utils/TableGen/ClangDiagnosticsEmitter.cpp @@ -926,16 +926,18 @@ struct DiagText { void print(std::vector &RST) override; }; - std::vector> Pieces; + // FIXME: This should be a unique_ptr, but I can't figure out how to get MSVC + // to not issue errors on that. + std::vector> Pieces; DiagText(); - DiagText(DiagText &&O) : Pieces(std::move(O.Pieces)) {} + DiagText(DiagText &&O) LLVM_NOEXCEPT : Pieces(std::move(O.Pieces)) {} DiagText(StringRef Text); DiagText(StringRef Kind, StringRef Text); template void add(P Piece) { - Pieces.push_back(llvm::make_unique

(std::move(Piece))); + Pieces.push_back(std::make_shared

(std::move(Piece))); } void print(std::vector &RST); }; @@ -1032,7 +1034,7 @@ DiagText::DiagText(StringRef Kind, StringRef Text) : DiagText(parseDiagText(Text Prefix.Role = Kind; Prefix.Text = Kind; Prefix.Text += ": "; - Pieces.insert(Pieces.begin(), llvm::make_unique(std::move(Prefix))); + Pieces.insert(Pieces.begin(), std::make_shared(std::move(Prefix))); } void escapeRST(StringRef Str, std::string &Out) {