[ADT] function_ref's constructor is unavailable if the argument is not callable.

This allows overload sets containing function_ref arguments to work correctly
Otherwise they're ambiguous as anything "could be" converted to a function_ref.

This matches proposed std::function_ref, absl::function_ref, etc.

Differential Revision: https://reviews.llvm.org/D88901
This commit is contained in:
Sam McCall
2020-10-06 16:35:35 +02:00
parent 149dc94c1d
commit 4cae6228d1
4 changed files with 26 additions and 6 deletions

View File

@@ -579,9 +579,7 @@ public:
/// \returns true if an error occurred.
Error parseBitcodeInto(
Module *M, bool ShouldLazyLoadMetadata = false, bool IsImporting = false,
DataLayoutCallbackTy DataLayoutCallback = [](std::string) {
return None;
});
DataLayoutCallbackTy DataLayoutCallback = [](StringRef) { return None; });
static uint64_t decodeSignRotatedValue(uint64_t V);