Index: unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp =================================================================== --- unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp +++ unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp @@ -67,15 +67,10 @@ /// \returns true if there were errors, false otherwise. template static bool HandleExpectedError(T &Expected) { - std::string ErrorMsg; - handleAllErrors(Expected.takeError(), [&](const ErrorInfoBase &EI) { - ErrorMsg = EI.message(); - }); - if (!ErrorMsg.empty()) { - ::testing::AssertionFailure() << "error: " << ErrorMsg; - return true; - } - return false; + if (Expected) + return false; + llvm::consumeError(Expected.takeError()); + return true; } template