[PATCH] D135495: [clang-tidy] handle exceptions properly `ExceptionAnalyzer`
Gábor Horváth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 20 15:46:28 PST 2023
xazax.hun added a comment.
Overall, I like the structure of this patch and the references back to the standard. But every time we compare type pointers, they might compare inequal when one of the types have sugar on it while the other does not. Please review all of those comparisons to see where do we need to get the canonical types instead, and add some tests with type aliases.
================
Comment at: clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp:66
+ CXXBasePath &) {
+ if (BS->getType()->getAsCXXRecordDecl() == BaseClass &&
+ BS->getAccessSpecifier() == AS_public) {
----------------
Will this work with typedefs and other sugar or do you need to get the canonical type here? I do not see test coverage for that scenario.
================
Comment at: clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp:84
+
+QualType getPointeeOrArrayElementQualType(QualType T) {
+ if (T->isAnyPointerType())
----------------
What about `Type::getPointeeOrArrayElementType`?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135495/new/
https://reviews.llvm.org/D135495
More information about the cfe-commits
mailing list