This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Skip parentheses in `readability-make-member-function-const`
ClosedPublic

Authored by Izaron on Mar 19 2022, 11:28 AM.

Details

Summary

The checker should ignore parentheses when looking whether the
function should be marked as const.

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

Diff Detail

Event Timeline

Izaron created this revision.Mar 19 2022, 11:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 19 2022, 11:28 AM
Izaron requested review of this revision.Mar 19 2022, 11:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 19 2022, 11:28 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
mgehre-amd accepted this revision.Mar 21 2022, 1:20 AM
This revision is now accepted and ready to land.Mar 21 2022, 1:20 AM
njames93 accepted this revision.Mar 21 2022, 1:51 AM

Mostly LGTM, just a few nits

clang-tools-extra/clang-tidy/readability/MakeMemberFunctionConstCheck.cpp
69

This change looks unrelated to what this patch is trying to achieve

71

Maybe rename this to getParentExprIgnoreParens to be more explicit in what you are trying to achieve.

113

Ditto

Izaron updated this revision to Diff 416870.Mar 21 2022, 2:47 AM

Fixed as suggested by njames93. Thank you!

Izaron marked 3 inline comments as done.Mar 21 2022, 2:47 AM