[PATCH] D122075: [clang-tidy] Skip parentheses in `readability-make-member-function-const`

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 21 01:51:12 PDT 2022


njames93 accepted this revision.
njames93 added a comment.

Mostly LGTM, just a few nits



================
Comment at: clang-tools-extra/clang-tidy/readability/MakeMemberFunctionConstCheck.cpp:69
 
+  const Stmt *getParentStmt(const Expr *E) { return getParent<Stmt>(E); }
+
----------------
This change looks unrelated to what this patch is trying to achieve


================
Comment at: clang-tools-extra/clang-tidy/readability/MakeMemberFunctionConstCheck.cpp:71
+
+  const Expr *getParentExpr(const Expr *E) {
+    const Expr *Parent = getParent<Expr>(E);
----------------
Maybe rename this to getParentExprIgnoreParens to be more explicit in what you are trying to achieve.


================
Comment at: clang-tools-extra/clang-tidy/readability/MakeMemberFunctionConstCheck.cpp:115
 
-    const auto *Parent = getParent<Stmt>(Cast);
+    const auto *Parent = getParentStmt(Cast);
     if (!Parent)
----------------
Ditto


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122075/new/

https://reviews.llvm.org/D122075



More information about the cfe-commits mailing list