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

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 1 11:07:33 PDT 2019


gribozavr2 accepted this revision.
gribozavr2 added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clang-tidy/readability/MakeMemberFunctionConstCheck.cpp:180
+    //  use((const S*)this);
+    //  (const S*)->f()
+    // when 'f' is a public member function.
----------------
I think you meant `((const S*)this)->f()`.


================
Comment at: clang-tools-extra/test/clang-tidy/readability-make-member-function-const.cpp:21
+  Str S;
+  Str Sref;
+
----------------
Did you mean `Str &Sref`?


================
Comment at: clang-tools-extra/test/clang-tidy/readability-make-member-function-const.cpp:168
+
+  int M;
+  int keepConst() const { return M; }
----------------
Move up, close to other data members?


================
Comment at: clang-tools-extra/test/clang-tidy/readability-make-member-function-const.cpp:179
+
+  Str S;
+  void call_non_const_member_on_field() { S.non_const_method(); }
----------------
Move up, close to other data members?


================
Comment at: clang-tools-extra/test/clang-tidy/readability-make-member-function-const.cpp:247
+template <class Base>
+struct KeepWithTemplateBase : public Base {
+  int M;
----------------
"DependentBase"


================
Comment at: clang-tools-extra/test/clang-tidy/readability-make-member-function-const.cpp:255
+template <class T>
+struct KeepTemplateClass {
+  int M;
----------------
"ClassTemplate"



================
Comment at: clang-tools-extra/test/clang-tidy/readability-make-member-function-const.cpp:262
+
+struct KeepTemplateMethod {
+  int M;
----------------
"MemberFunctionTemplate"


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