[PATCH] D148461: [clang-tidy] Support C++17/20 in bugprone-exception-escape
Domján Dániel via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Apr 16 13:13:55 PDT 2023
isuckatcs added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp:160-162
+ // FIXME: Two function pointers can differ in 'noexcept', but they still
+ // should be considered to be same, now this triggers false-positive because
+ // Type* != Type*.
----------------
Are you sure `noexcept` is stored in the type? The test case you modified `throw_noexcept_catch_regular()` tests this scenario and in that case the types seem to be the same even though one of the is noexcept an the other is not.
If the FIXME is valid the proper way would be to implement it in this patch.
================
Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape.cpp:414
throw &foo;
- } catch(int (*)()) {
+ } catch(int (*)() noexcept) {
}
----------------
The name of the function suggests that we throw a noexcept function pointer and catch a non-noexcept one. Please don't change it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148461/new/
https://reviews.llvm.org/D148461
More information about the cfe-commits
mailing list