Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 4d206e7

Browse files
committed
Attempt #3 to placate MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281197 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 1f95189 commit 4d206e7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

utils/TableGen/ClangDiagnosticsEmitter.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -926,16 +926,18 @@ struct DiagText {
926926
void print(std::vector<std::string> &RST) override;
927927
};
928928

929-
std::vector<std::unique_ptr<Piece>> Pieces;
929+
// FIXME: This should be a unique_ptr, but I can't figure out how to get MSVC
930+
// to not issue errors on that.
931+
std::vector<std::shared_ptr<Piece>> Pieces;
930932

931933
DiagText();
932-
DiagText(DiagText &&O) : Pieces(std::move(O.Pieces)) {}
934+
DiagText(DiagText &&O) LLVM_NOEXCEPT : Pieces(std::move(O.Pieces)) {}
933935

934936
DiagText(StringRef Text);
935937
DiagText(StringRef Kind, StringRef Text);
936938

937939
template<typename P> void add(P Piece) {
938-
Pieces.push_back(llvm::make_unique<P>(std::move(Piece)));
940+
Pieces.push_back(std::make_shared<P>(std::move(Piece)));
939941
}
940942
void print(std::vector<std::string> &RST);
941943
};
@@ -1032,7 +1034,7 @@ DiagText::DiagText(StringRef Kind, StringRef Text) : DiagText(parseDiagText(Text
10321034
Prefix.Role = Kind;
10331035
Prefix.Text = Kind;
10341036
Prefix.Text += ": ";
1035-
Pieces.insert(Pieces.begin(), llvm::make_unique<TextPiece>(std::move(Prefix)));
1037+
Pieces.insert(Pieces.begin(), std::make_shared<TextPiece>(std::move(Prefix)));
10361038
}
10371039

10381040
void escapeRST(StringRef Str, std::string &Out) {

0 commit comments

Comments
 (0)