[PATCH] D68074: [clang-tidy] Add readability-make-member-function-const

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 26 09:51:44 PDT 2019


Eugene.Zelenko added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/readability/MakeMemberFunctionConstCheck.cpp:60
+  template <class T> const T *getParent(const Expr *E) {
+    auto Parents = Ctxt.getParents(*E);
+    if (Parents.size() != 1)
----------------
Return type is not obvious, so auto should not be used.


================
Comment at: clang-tools-extra/clang-tidy/readability/MakeMemberFunctionConstCheck.cpp:145
+
+    if (auto *Cast = dyn_cast_or_null<ImplicitCastExpr>(Parent)) {
+      // A read access to a member is safe when the member either
----------------
Is Cast changed, if not, const auto * should be used. Same in other places.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68074





More information about the cfe-commits mailing list