summaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/LogDiagnosticPrinter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/LogDiagnosticPrinter.cpp')
-rw-r--r--clang/lib/Frontend/LogDiagnosticPrinter.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Frontend/LogDiagnosticPrinter.cpp b/clang/lib/Frontend/LogDiagnosticPrinter.cpp
index 4bac17553999d..df8b23691a7d3 100644
--- a/clang/lib/Frontend/LogDiagnosticPrinter.cpp
+++ b/clang/lib/Frontend/LogDiagnosticPrinter.cpp
@@ -120,7 +120,7 @@ void LogDiagnosticPrinter::HandleDiagnostic(DiagnosticsEngine::Level Level,
if (FID.isValid()) {
const FileEntry *FE = SM.getFileEntryForID(FID);
if (FE && FE->isValid())
- MainFilename = FE->getName();
+ MainFilename = std::string(FE->getName());
}
}
@@ -129,12 +129,13 @@ void LogDiagnosticPrinter::HandleDiagnostic(DiagnosticsEngine::Level Level,
DE.DiagnosticID = Info.getID();
DE.DiagnosticLevel = Level;
- DE.WarningOption = DiagnosticIDs::getWarningOptionForDiag(DE.DiagnosticID);
+ DE.WarningOption =
+ std::string(DiagnosticIDs::getWarningOptionForDiag(DE.DiagnosticID));
// Format the message.
SmallString<100> MessageStr;
Info.FormatDiagnostic(MessageStr);
- DE.Message = MessageStr.str();
+ DE.Message = std::string(MessageStr.str());
// Set the location information.
DE.Filename = "";
@@ -149,7 +150,7 @@ void LogDiagnosticPrinter::HandleDiagnostic(DiagnosticsEngine::Level Level,
if (FID.isValid()) {
const FileEntry *FE = SM.getFileEntryForID(FID);
if (FE && FE->isValid())
- DE.Filename = FE->getName();
+ DE.Filename = std::string(FE->getName());
}
} else {
DE.Filename = PLoc.getFilename();