This is an archive of the discontinued LLVM Phabricator instance.

[tidy][IdentifierNaming] Fix crashes on non-identifiers
ClosedPublic

Authored by kadircet on May 9 2023, 2:30 AM.

Diff Detail

Event Timeline

kadircet created this revision.May 9 2023, 2:30 AM
Herald added a project: Restricted Project. · View Herald Transcript
kadircet requested review of this revision.May 9 2023, 2:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 9 2023, 2:30 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
PiotrZSL accepted this revision.May 9 2023, 2:49 AM

LGTM, fell free to deliver (to quickly fix crash).
Any improvements could be done later.

clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp
461

Most probably this could be done before for, as overridden/cannonical decl should have same naming.
And looks we get here from VisitMemberExpr.

clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-nocrash.cpp
3–5 ↗(On Diff #520633)

i would merge this with some existing test file...

This revision is now accepted and ready to land.May 9 2023, 2:49 AM
PiotrZSL added inline comments.May 9 2023, 2:52 AM
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-nocrash.cpp
3–5 ↗(On Diff #520633)

yep, tests fails due to lack of CHECK_MESSGAES, merge this with some other test file, main one for example.

kadircet updated this revision to Diff 520648.May 9 2023, 3:50 AM
kadircet marked 3 inline comments as done.

Merge with existing tests
Perform check earlier

This revision was landed with ongoing or failed builds.May 9 2023, 3:51 AM
This revision was automatically updated to reflect the committed changes.
VitaNuo added inline comments.May 9 2023, 4:05 AM
clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp
461

Could you do an early return instead? I believe it's clearer.