From: Reid Kleckner Date: Tue, 13 Sep 2016 22:22:56 +0000 (+0000) Subject: Fix a FIXME about MSVC 2013 in the diagnostic doc generation code X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=238012f2b7106ee47d2a3336ba054689af0fad54;p=clang Fix a FIXME about MSVC 2013 in the diagnostic doc generation code Ultimately it boiled down to adding a move constructor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281408 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/TableGen/ClangDiagnosticsEmitter.cpp b/utils/TableGen/ClangDiagnosticsEmitter.cpp index 00769a4557..036e742311 100644 --- a/utils/TableGen/ClangDiagnosticsEmitter.cpp +++ b/utils/TableGen/ClangDiagnosticsEmitter.cpp @@ -928,13 +928,14 @@ struct DiagText { void print(std::vector &RST) override; }; struct SelectPiece : Piece { + SelectPiece() {} + SelectPiece(SelectPiece &&O) LLVM_NOEXCEPT : Options(std::move(O.Options)) { + } std::vector Options; void print(std::vector &RST) override; }; - // 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; + std::vector> Pieces; DiagText(); DiagText(DiagText &&O) LLVM_NOEXCEPT : Pieces(std::move(O.Pieces)) {} @@ -943,7 +944,7 @@ struct DiagText { DiagText(StringRef Kind, StringRef Text); template void add(P Piece) { - Pieces.push_back(std::make_shared

(std::move(Piece))); + Pieces.push_back(llvm::make_unique

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