[PATCH] D132745: [clang] Fix ambiguous use of `report_fatal_error`.

weiyi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 26 08:58:43 PDT 2022


wyt created this revision.
Herald added a project: All.
wyt requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

`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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132745

Files:
  clang/lib/Basic/SanitizerSpecialCaseList.cpp


Index: clang/lib/Basic/SanitizerSpecialCaseList.cpp
===================================================================
--- clang/lib/Basic/SanitizerSpecialCaseList.cpp
+++ clang/lib/Basic/SanitizerSpecialCaseList.cpp
@@ -33,7 +33,7 @@
   std::string Error;
   if (auto SSCL = create(Paths, VFS, Error))
     return SSCL;
-  llvm::report_fatal_error(Error);
+  llvm::report_fatal_error(llvm::StringRef(Error));
 }
 
 void SanitizerSpecialCaseList::createSanitizerSections() {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132745.455934.patch
Type: text/x-patch
Size: 476 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220826/6cb67755/attachment.bin>


More information about the cfe-commits mailing list