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)'
Reviewed By: RKSimon, barannikov88
Differential Revision: https://reviews.llvm.org/D130407
//===----------------------------------------------------------------------===//
#include "llvm/IR/GCStrategy.h"
+#include "llvm/ADT/Twine.h"
using namespace llvm;
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()));
}