[clang] d346eb7 - [clang] Fix ambiguous use of `report_fatal_error`.
Wei Yi Tee via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 29 08:33:28 PDT 2022
Author: Wei Yi Tee
Date: 2022-08-29T15:32:49Z
New Revision: d346eb7bf08c7780bb80426eabc6b5f81490e9ae
URL: https://github.com/llvm/llvm-project/commit/d346eb7bf08c7780bb80426eabc6b5f81490e9ae
DIFF: https://github.com/llvm/llvm-project/commit/d346eb7bf08c7780bb80426eabc6b5f81490e9ae.diff
LOG: [clang] Fix ambiguous use of `report_fatal_error`.
`report_fatal_error` is overloaded on `StringRef` and `Twine &`, therefore passing a `std::string` argument leads to ambiguity as it is convertible to either type.
Reviewed By: gribozavr2, sgatev
Differential Revision: https://reviews.llvm.org/D132745
Added:
Modified:
clang/lib/Basic/SanitizerSpecialCaseList.cpp
Removed:
################################################################################
diff --git a/clang/lib/Basic/SanitizerSpecialCaseList.cpp b/clang/lib/Basic/SanitizerSpecialCaseList.cpp
index 5bf8d39ffd95b..2dbf04c6ede97 100644
--- a/clang/lib/Basic/SanitizerSpecialCaseList.cpp
+++ b/clang/lib/Basic/SanitizerSpecialCaseList.cpp
@@ -33,7 +33,7 @@ SanitizerSpecialCaseList::createOrDie(const std::vector<std::string> &Paths,
std::string Error;
if (auto SSCL = create(Paths, VFS, Error))
return SSCL;
- llvm::report_fatal_error(Error);
+ llvm::report_fatal_error(StringRef(Error));
}
void SanitizerSpecialCaseList::createSanitizerSections() {
More information about the cfe-commits
mailing list