std::optional::value => operator*/operator->
authorFangrui Song <i@maskray.me>
Sat, 17 Dec 2022 03:12:04 +0000 (03:12 +0000)
committerFangrui Song <i@maskray.me>
Sat, 17 Dec 2022 03:12:04 +0000 (03:12 +0000)
commit53243f2a296178b899dcc569475bdcc7e5f30d3b
tree68683b4276b04a8f6fc919e262fbec67c135a5ca
parentb08acee423935c16a1503335d78b84ccbbae4ef8
std::optional::value => operator*/operator->

value() has undesired exception checking semantics and calls
__throw_bad_optional_access in libc++. Moreover, the API is unavailable without
_LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS).

This fixes check-clang-tools.
clang-tools-extra/clang-doc/HTMLGenerator.cpp
clang-tools-extra/clangd/ClangdLSPServer.cpp
clang-tools-extra/include-cleaner/unittests/AnalysisTest.cpp
llvm/lib/Transforms/IPO/AttributorAttributes.cpp