Index: llvm/include/llvm/Support/Error.h =================================================================== --- llvm/include/llvm/Support/Error.h +++ llvm/include/llvm/Support/Error.h @@ -670,7 +670,7 @@ } #endif - void assertIsChecked() { + void assertIsChecked() const { #if LLVM_ENABLE_ABI_BREAKING_CHECKS if (LLVM_UNLIKELY(Unchecked)) fatalUncheckedExpected(); Index: llvm/unittests/Support/ErrorTest.cpp =================================================================== --- llvm/unittests/Support/ErrorTest.cpp +++ llvm/unittests/Support/ErrorTest.cpp @@ -565,7 +565,7 @@ // Test runs in debug mode only. #if LLVM_ENABLE_ABI_BREAKING_CHECKS TEST(Error, UncheckedExpectedInSuccessModeAccess) { - EXPECT_DEATH({ Expected A = 7; *A; }, + EXPECT_DEATH({ const Expected A = 7; *A; }, "Expected must be checked before access or destruction.") << "Unchecekd Expected success value did not cause an abort()."; }