Some const methods of Expected<T> invoke assertIsChecked(), so we should mark it as const too.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
LG thanks!
I guess this didn't cause problems so far because usage of const Expected is rare.
(next time please upload with full context)
| llvm/unittests/Support/ErrorTest.cpp | ||
|---|---|---|
| 574 | Nit: unchecked (typo) | |
clang-format: please reformat the code
- 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()."; + 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().";