[PATCH] D62404: [clang-tidy] Fix null pointer dereference in readability-identifier-naming
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 27 07:36:10 PDT 2019
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM!
================
Comment at: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp:804
+ if (const auto *Typedef = TypePtr->getAs<TypedefType>()) {
+ addUsage(NamingCheckFailures, Typedef->getDecl(),
+ Value->getSourceRange());
----------------
madsravn wrote:
> hokein wrote:
> > We are risky of dereferencing a nullptr, as the `TypePtr` can be null now.
> Are we not checking for null in the line where `TypePtr` gets declared? Or am I misunderstanding?
I don't see a null pointer dereference here for `TypePtr`; I think the code is fine as-is.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62404/new/
https://reviews.llvm.org/D62404
More information about the cfe-commits
mailing list