This is an archive of the discontinued LLVM Phabricator instance.

[IR] Fixed ambiguous call to llvm::report_fatal_error
ClosedPublic

Authored by slydiman on Jul 22 2022, 6:26 PM.

Details

Summary

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)'

Diff Detail

Event Timeline

slydiman created this revision.Jul 22 2022, 6:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2022, 6:26 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
slydiman requested review of this revision.Jul 22 2022, 6:26 PM
barannikov88 added inline comments.
llvm/lib/IR/GCStrategy.cpp
38

Please include the missing header. It is the reason why this error was not caught earlier.

barannikov88 added inline comments.Jul 22 2022, 6:44 PM
llvm/lib/IR/GCStrategy.cpp
38

Sorry, the last part of my statement is not true. "Twine.h" seems to be transitively included from some other header, but not in all configurations.
"Twine.h" should be included now, because the class is directly used.

slydiman updated this revision to Diff 447035.Jul 22 2022, 9:08 PM
slydiman marked an inline comment as done.
slydiman updated this revision to Diff 447036.Jul 22 2022, 9:12 PM
This revision is now accepted and ready to land.Jul 22 2022, 11:47 PM
RKSimon accepted this revision.Jul 23 2022, 1:33 AM

LGTM

This revision was landed with ongoing or failed builds.Jul 23 2022, 7:28 AM
This revision was automatically updated to reflect the committed changes.