[PATCH] D130407: [IR] Fixed ambiguous call to llvm::report_fatal_error

Dmitry Vassiliev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 22 18:26:36 PDT 2022


slydiman created this revision.
slydiman added a reviewer: mkazantsev.
slydiman added a project: LLVM.
Herald added a subscriber: hiraditya.
Herald added a project: All.
slydiman requested review of this revision.
Herald added a subscriber: llvm-commits.

This patch fixes the following error with MSVC 16.9.2:
llvm/lib/IR/GCStrategy.cpp(35): error C2668: 'llvm::report_fatal_error': ambiguous call to overloaded function
llvm/include/llvm/Support/ErrorHandling.h(75): note: could be 'void llvm::report_fatal_error(const llvm::Twine &,bool)'
llvm/include/llvm/Support/ErrorHandling.h(73): note: or       'void llvm::report_fatal_error(llvm::StringRef,bool)'
llvm/lib/IR/GCStrategy.cpp(35): note: while trying to match the argument list '(const std::string)'


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130407

Files:
  llvm/lib/IR/GCStrategy.cpp


Index: llvm/lib/IR/GCStrategy.cpp
===================================================================
--- llvm/lib/IR/GCStrategy.cpp
+++ llvm/lib/IR/GCStrategy.cpp
@@ -32,7 +32,7 @@
     const std::string error =
         std::string("unsupported GC: ") + Name.str() +
         " (did you remember to link and initialize the library?)";
-    report_fatal_error(error);
+    report_fatal_error(Twine(error));
   } else
-    report_fatal_error(std::string("unsupported GC: ") + Name.str());
+    report_fatal_error(Twine(std::string("unsupported GC: ") + Name.str()));
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130407.447018.patch
Type: text/x-patch
Size: 570 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220723/51e47a51/attachment.bin>


More information about the llvm-commits mailing list