[PATCH] D138318: [-Wunsafe-buffer-usage] Improve pointer match pattern
Gábor Horváth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 18 15:04:00 PST 2022
xazax.hun added inline comments.
================
Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:31-39
+ hasType(pointerType()),
+ hasType(autoType(
+ hasDeducedType(hasUnqualifiedDesugaredType(pointerType())))),
+ // DecayedType, e.g., array type in formal parameter decl
+ hasType(decayedType(hasDecayedType(pointerType()))),
+ // ElaboratedType, e.g., typedef
+ hasType(elaboratedType(hasUnqualifiedDesugaredType(pointerType()))),
----------------
Isn't it possible to reduce the number of cases by using `hasCanonicalType`?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138318/new/
https://reviews.llvm.org/D138318
More information about the cfe-commits
mailing list