Skip to content
Snippets Groups Projects
Commit 4d206e7d authored by Richard Smith's avatar Richard Smith
Browse files

Attempt #3 to placate MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281197 91177308-0d34-0410-b5e6-96231b3b80d8
parent 1f951891
No related branches found
No related tags found
No related merge requests found
...@@ -926,16 +926,18 @@ struct DiagText { ...@@ -926,16 +926,18 @@ struct DiagText {
void print(std::vector<std::string> &RST) override; void print(std::vector<std::string> &RST) override;
}; };
std::vector<std::unique_ptr<Piece>> 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<std::shared_ptr<Piece>> Pieces;
DiagText(); DiagText();
DiagText(DiagText &&O) : Pieces(std::move(O.Pieces)) {} DiagText(DiagText &&O) LLVM_NOEXCEPT : Pieces(std::move(O.Pieces)) {}
DiagText(StringRef Text); DiagText(StringRef Text);
DiagText(StringRef Kind, StringRef Text); DiagText(StringRef Kind, StringRef Text);
template<typename P> void add(P Piece) { template<typename P> void add(P Piece) {
Pieces.push_back(llvm::make_unique<P>(std::move(Piece))); Pieces.push_back(std::make_shared<P>(std::move(Piece)));
} }
void print(std::vector<std::string> &RST); void print(std::vector<std::string> &RST);
}; };
...@@ -1032,7 +1034,7 @@ DiagText::DiagText(StringRef Kind, StringRef Text) : DiagText(parseDiagText(Text ...@@ -1032,7 +1034,7 @@ DiagText::DiagText(StringRef Kind, StringRef Text) : DiagText(parseDiagText(Text
Prefix.Role = Kind; Prefix.Role = Kind;
Prefix.Text = Kind; Prefix.Text = Kind;
Prefix.Text += ": "; Prefix.Text += ": ";
Pieces.insert(Pieces.begin(), llvm::make_unique<TextPiece>(std::move(Prefix))); Pieces.insert(Pieces.begin(), std::make_shared<TextPiece>(std::move(Prefix)));
} }
void escapeRST(StringRef Str, std::string &Out) { void escapeRST(StringRef Str, std::string &Out) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment