diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp index 1de74869d217..ed8d00256e7c 100644 --- a/llvm/tools/gold/gold-plugin.cpp +++ b/llvm/tools/gold/gold-plugin.cpp @@ -392,7 +392,7 @@ static void diagnosticHandler(const DiagnosticInfo &DI) { } static void check(Error E, std::string Msg = "LLVM gold plugin") { - handleAllErrors(std::move(E), [&](ErrorInfoBase &EIB) { + handleAllErrors(std::move(E), [&](ErrorInfoBase &EIB) -> Error { message(LDPL_FATAL, "%s: %s", Msg.c_str(), EIB.message().c_str()); return Error::success(); });