[clang-tidy] Fix false negative in readability-convert-member-functions-to-static
authorNathan James <n.james93@hotmail.co.uk>
Sat, 24 Jun 2023 14:18:20 +0000 (14:18 +0000)
committerPiotr Zegar <me@piotrzegar.pl>
Sat, 24 Jun 2023 14:35:11 +0000 (14:35 +0000)
commit67e05d380c2253319c22451d340e2e3c2043b6d8
tree9bd13d1c5e5f3e583137901ce901a8b7d24e0642
parentc35e4cf7ba362e0f2b1c5978bb22bbb9ae955c30
[clang-tidy] Fix false negative in readability-convert-member-functions-to-static

A nested class in a member function can erroneously confuse 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

Reviewed By: PiotrZSL

Differential Revision: https://reviews.llvm.org/D130665
clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStatic.cpp
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/test/clang-tidy/checkers/readability/convert-member-functions-to-static.cpp