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

2019-11-06 Thread Matthias Gehre via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG24130d661ed4: [clang-tidy] Add readability-make-member-function-const (authored by mgehre). Changed prior to commit: https://reviews.llvm.org/D68074?vs=225804=228006#toc Repository: rG LLVM Github

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

2019-11-02 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre marked 8 inline comments as done. mgehre added a comment. Thanks, fixed! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68074/new/ https://reviews.llvm.org/D68074 ___ cfe-commits mailing list

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

2019-11-01 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang-tools-extra/test/clang-tidy/readability-make-member-function-const.cpp:321 + +} // namespace Keep Could you add tests for calls to members of `this` through member function pointers? I don't care about

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

2019-11-01 Thread Dmitri Gribenko via Phabricator via cfe-commits
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

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

2019-10-30 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre added a comment. Friendly Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68074/new/ https://reviews.llvm.org/D68074 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2019-10-20 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre updated this revision to Diff 225804. mgehre marked 6 inline comments as done. mgehre added a comment. - Update documentation Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68074/new/ https://reviews.llvm.org/D68074 Files:

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

2019-10-11 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/readability-make-member-function-const.rst:10 +The check conservatively tries to preserve logical costness in favor of +physical costness. The only operations on ``this`` that this check

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

2019-10-09 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre marked 2 inline comments as done. mgehre added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/readability-make-member-function-const.rst:10 +The check conservatively tries to preserve logical costness in favor of +physical costness. The only

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

2019-10-09 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre marked an inline comment as done. mgehre added inline comments. Comment at: clang-tools-extra/test/clang-tidy/readability-make-member-function-const.cpp:311 + // This member function must stay non-const, even though + // it only calls other private const member

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

2019-10-08 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr added a comment. I'm holding off on reviewing the code until we figure out what the rules are. Comment at: clang-tools-extra/docs/clang-tidy/checks/readability-make-member-function-const.rst:10 +The check conservatively tries to preserve logical costness in favor of

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

2019-09-29 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre added a comment. In D68074#1683770 , @lebedev.ri wrote: > Awesome! > I believe i have asked this question in the convert-to-static diff - can > ExprMutAnalyzer be used here? I believe in this case, we can get away with a simpler analysis.

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

2019-09-29 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre updated this revision to Diff 222331. mgehre marked 6 inline comments as done. mgehre added a comment. - Implement review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68074/new/ https://reviews.llvm.org/D68074 Files:

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

2019-09-26 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/readability/MakeMemberFunctionConstCheck.cpp:60 + template const T *getParent(const Expr *E) { +auto Parents = Ctxt.getParents(*E); +if (Parents.size() != 1) Return type is

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

2019-09-26 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. See also PR21981 and D45444 . Comment at: clang-tools-extra/clang-tidy/readability/MakeMemberFunctionConstCheck.cpp:93 + bool VisitUser(const ImplicitCastExpr *Cast) { + +if (Cast->getCastKind() != CK_NoOp)

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

2019-09-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Awesome! I believe i have asked this question in the convert-to-static diff - can ExprMutAnalyzer be used here? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68074/new/ https://reviews.llvm.org/D68074

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

2019-09-26 Thread Noel Grandin via Phabricator via cfe-commits
grandinj added a comment. Nice! I went with a more brute force approach, and I also struggled with logical vs physical const-correctness https://cgit.freedesktop.org/libreoffice/core/tree/compilerplugins/clang/store/constmethod.cxx Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

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

2019-09-26 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre created this revision. mgehre added reviewers: aaron.ballman, gribozavr, hokein, alexfh. mgehre added a project: clang. Herald added subscribers: xazax.hun, mgorny. Finds non-static member functions that can be made ``const`` because the functions don't use ``this`` in a non-const way.