[PATCH] D105292: [NFC] Mark Expected<T>::assertIsChecked() as const
xndcn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 1 10:27:48 PDT 2021
xndcn updated this revision to Diff 355933.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105292/new/
https://reviews.llvm.org/D105292
Files:
llvm/include/llvm/Support/Error.h
llvm/unittests/Support/ErrorTest.cpp
Index: llvm/unittests/Support/ErrorTest.cpp
===================================================================
--- llvm/unittests/Support/ErrorTest.cpp
+++ llvm/unittests/Support/ErrorTest.cpp
@@ -565,9 +565,13 @@
// Test runs in debug mode only.
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
TEST(Error, UncheckedExpectedInSuccessModeAccess) {
- EXPECT_DEATH({ Expected<int> A = 7; *A; },
- "Expected<T> must be checked before access or destruction.")
- << "Unchecekd Expected<T> success value did not cause an abort().";
+ EXPECT_DEATH(
+ {
+ const Expected<int> A = 7;
+ *A;
+ },
+ "Expected<T> must be checked before access or destruction.")
+ << "Unchecekd Expected<T> success value did not cause an abort().";
}
#endif
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();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105292.355933.patch
Type: text/x-patch
Size: 1163 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210701/1dbf7c5b/attachment.bin>
More information about the llvm-commits
mailing list