[PATCH] D148461: [clang-tidy] Support C++17/20 in bugprone-exception-escape
Piotr Zegar via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Jun 11 09:40:55 PDT 2023
PiotrZSL added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp:306
+
+ if (From->isMemberPointerType() || To->isMemberPointerType())
return false;
----------------
isuckatcs wrote:
> isuckatcs wrote:
> > Please cover this line with both positive and negative test cases.
> >
> > Also upon looking up both [[ https://www.open-std.org/jtc1/sc22/wg21/docs/standards | N4849 ]] (C++ 20 draft) and [[ https://github.com/cplusplus/draft/releases | N4917]] (C++ 23 draft), they both say for qualification conversion that
> >
> >
> > > each P_i is ... pointer to member of class C_i of type, ...
> >
> > Why are we not allowing them if the standard is at least C++ 20?
> Please resolve this thread.
Positive case is tested by throw_basefn_catch_derivedfn test and throw_derivedfn_catch_basefn.
Negative is covered by throw_basefn_catch_basefn.
For members there are tests throw_basem_catch_basem, throw_basem_catch_derivedm, throw_derivedm_catch_basem that also covers this correctly.
Tested this with GCC, and behavior is proper and independent to C++ standard.
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