[clang] 2b36e85 - GCC5 buildbot made it to clang. Fix implicit conversions it found.
Benjamin Kramer via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 28 17:20:00 PST 2020
Author: Benjamin Kramer
Date: 2020-01-29T02:19:49+01:00
New Revision: 2b36e85542d24161ff4460cb4f0da635e9f5ab62
URL: https://github.com/llvm/llvm-project/commit/2b36e85542d24161ff4460cb4f0da635e9f5ab62
DIFF: https://github.com/llvm/llvm-project/commit/2b36e85542d24161ff4460cb4f0da635e9f5ab62.diff
LOG: GCC5 buildbot made it to clang. Fix implicit conversions it found.
Added:
Modified:
clang/include/clang/Lex/PreprocessorOptions.h
clang/lib/Basic/DiagnosticIDs.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/Lex/PreprocessorOptions.h b/clang/include/clang/Lex/PreprocessorOptions.h
index abffbd03c3b4..c281cd51e266 100644
--- a/clang/include/clang/Lex/PreprocessorOptions.h
+++ b/clang/include/clang/Lex/PreprocessorOptions.h
@@ -192,15 +192,19 @@ class PreprocessorOptions {
public:
PreprocessorOptions() : PrecompiledPreambleBytes(0, false) {}
- void addMacroDef(StringRef Name) { Macros.emplace_back(Name, false); }
- void addMacroUndef(StringRef Name) { Macros.emplace_back(Name, true); }
+ void addMacroDef(StringRef Name) {
+ Macros.emplace_back(std::string(Name), false);
+ }
+ void addMacroUndef(StringRef Name) {
+ Macros.emplace_back(std::string(Name), true);
+ }
void addRemappedFile(StringRef From, StringRef To) {
- RemappedFiles.emplace_back(From, To);
+ RemappedFiles.emplace_back(std::string(From), std::string(To));
}
void addRemappedFile(StringRef From, llvm::MemoryBuffer *To) {
- RemappedFileBuffers.emplace_back(From, To);
+ RemappedFileBuffers.emplace_back(std::string(From), To);
}
void clearRemappedFiles() {
diff --git a/clang/lib/Basic/DiagnosticIDs.cpp b/clang/lib/Basic/DiagnosticIDs.cpp
index e30e3753d193..6f8b5440a4f3 100644
--- a/clang/lib/Basic/DiagnosticIDs.cpp
+++ b/clang/lib/Basic/DiagnosticIDs.cpp
@@ -289,7 +289,7 @@ namespace clang {
unsigned getOrCreateDiagID(DiagnosticIDs::Level L, StringRef Message,
DiagnosticIDs &Diags) {
- DiagDesc D(L, Message);
+ DiagDesc D(L, std::string(Message));
// Check to see if it already exists.
std::map<DiagDesc, unsigned>::iterator I = DiagIDs.lower_bound(D);
if (I != DiagIDs.end() && I->first == D)
More information about the cfe-commits
mailing list