This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix false negative in readability-convert-member-functions-to-static
ClosedPublic

Authored by njames93 on Jul 27 2022, 2:42 PM.

Details

Summary

A nested class in a member function can erroneously confuse the the check into thinking that any CXXThisExpr found relate to the outer class, preventing any warnings.
Fix this by not traversing any nested classes.

Fixes https://github.com/llvm/llvm-project/issues/56765

Diff Detail

Event Timeline

njames93 created this revision.Jul 27 2022, 2:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 27 2022, 2:42 PM
njames93 requested review of this revision.Jul 27 2022, 2:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 27 2022, 2:42 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
LegalizeAdulthood resigned from this revision.Mar 29 2023, 8:28 AM
PiotrZSL accepted this revision.Apr 14 2023, 12:05 PM

Looks good, release notes need to be corrected (order of checks) (even that it apply without conflicts) and could land.
Test properly fail without fix.

This revision is now accepted and ready to land.Apr 14 2023, 12:05 PM