[clang-tools-extra] [clang-tidy] Fix false positive in readability-convert-member-functions-to-static for const overloads (PR #191712)
Baranov Victor via cfe-commits
cfe-commits at lists.llvm.org
Sat Apr 18 06:09:51 PDT 2026
================
@@ -135,6 +159,9 @@ void ConvertMemberFunctionsToStaticCheck::check(
const MatchFinder::MatchResult &Result) {
const auto *Definition = Result.Nodes.getNodeAs<CXXMethodDecl>("x");
+ if (Definition->isConst() && hasNonConstOverload(*Definition))
+ return;
----------------
vbvictor wrote:
This should be part of the mather
write: `unless(allOf(IsConst(), HasNonConstOverload()))` and convert `hasNonConstOverload` to custom matcher.
https://github.com/llvm/llvm-project/pull/191712
More information about the cfe-commits
mailing list