Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-07-22 Thread Murray Cumming via cfe-commits
murrayc added inline comments. Comment at: clang-tidy/modernize/ExplicitOperatorBoolCheck.cpp:38 @@ +37,3 @@ + Finder->addMatcher( + cxxConversionDecl(returns(booleanType()), unless(isExplicit())) + .bind("operator-bool"), alexfh wrote: > Please mer

Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-07-07 Thread Alexander Kornienko via cfe-commits
alexfh requested changes to this revision. alexfh added a comment. This revision now requires changes to proceed. Sorry for the delay. Feel free to ping me earlier. Comment at: clang-tidy/modernize/ExplicitOperatorBoolCheck.cpp:38 @@ +37,3 @@ + Finder->addMatcher( + cxxCon

Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-06-30 Thread Murray Cumming via cfe-commits
murrayc added a comment. I'd still be perfectly happy if just the simple check for implicit operator bool was accepted. http://reviews.llvm.org/D20857 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/lis

Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-06-30 Thread Murray Cumming via cfe-commits
murrayc updated this revision to Diff 62355. murrayc marked an inline comment as done. murrayc added a comment. Same as previous patch, but with a tiny suggested whitespace corretion. http://reviews.llvm.org/D20857 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ExplicitOper

Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-06-04 Thread Murray Cumming via cfe-commits
murrayc added a comment. In http://reviews.llvm.org/D20857#449080, @alexfh wrote: > Looks like a useful check to have. I'm not sure though, that it has anything > to do with "modernize". I'd suggest adding a new "bugprone" module (should be > added by http://reviews.llvm.org/D18821, hopefully s

Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-06-03 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. Looks like a useful check to have. I'm not sure though, that it has anything to do with "modernize". I'd suggest adding a new "bugprone" module (should be added by http://reviews.llvm.org/D18821, hopefully soon) and moving the check there. Comment at:

Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-06-03 Thread Murray Cumming via cfe-commits
murrayc updated this revision to Diff 59537. murrayc added a comment. Combined into one check. Also specifies C++11 for the test. http://reviews.llvm.org/D20857 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ExplicitOperatorBoolCheck.cpp clang-tidy/modernize/ExplicitOpera

Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-06-02 Thread Eugene Zelenko via cfe-commits
Eugene.Zelenko added a comment. I think single check will be better from user's point of view. Comment at: docs/clang-tidy/checks/modernize-explicit-operator-bool.rst:12 @@ +11,3 @@ +have no ``operator ==`` overloads, an implicit ``operator bool`` would allow +``a == b`` to comp

Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-06-02 Thread Etienne Bergeron via cfe-commits
etienneb added inline comments. Comment at: test/clang-tidy/modernize-operator-void-pointer.cpp:39 @@ +38,3 @@ +class SomethingGoodNonConstVoidPtr { + // A non-const void* is unlikely to to be meant as operator bool before C++11 + // let us use explicit. You kno

Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-06-02 Thread Aaron Ballman via cfe-commits
aaron.ballman added a comment. In http://reviews.llvm.org/D20857#446784, @murrayc wrote: > In http://reviews.llvm.org/D20857#446732, @etienneb wrote: > > > Enabling/disabling can be done with options (see SizeofExpressionCheck). > > > Thanks. Am I being asked to combine the checks? I would pref

Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-06-02 Thread Murray Cumming via cfe-commits
murrayc added inline comments. Comment at: clang-tidy/modernize/OperatorVoidPointerCheck.cpp:27 @@ +26,3 @@ + Finder->addMatcher(cxxConversionDecl(returns(pointerType(pointee( + isConstQualified(), voidType(, +

Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-06-02 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. In http://reviews.llvm.org/D20857#446784, @murrayc wrote: > In http://reviews.llvm.org/D20857#446732, @etienneb wrote: > > > Enabling/disabling can be done with options (see SizeofExpressionCheck). > > > Thanks. Am I being asked to combine the checks? I'll let alexfh@

Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-06-02 Thread Murray Cumming via cfe-commits
murrayc added a comment. In http://reviews.llvm.org/D20857#446732, @etienneb wrote: > Enabling/disabling can be done with options (see SizeofExpressionCheck). Thanks. Am I being asked to combine the checks? http://reviews.llvm.org/D20857 ___ cfe-

Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-06-02 Thread Murray Cumming via cfe-commits
murrayc updated this revision to Diff 59367. murrayc added a comment. With suggested changes. Ran clang-format (LLVM style). Used voidType() matcher. http://reviews.llvm.org/D20857 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ExplicitOperatorBoolCheck.cpp clang-tidy/mod

Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-06-02 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. In http://reviews.llvm.org/D20857#446654, @murrayc wrote: > In http://reviews.llvm.org/D20857#446101, @etienneb wrote: > > > I wonder if these two checks should not be merge in one checker. > > > Personally I find it cleaner to keep them separate, but I would be happy to

Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-06-02 Thread Murray Cumming via cfe-commits
murrayc added a comment. In http://reviews.llvm.org/D20857#446101, @etienneb wrote: > I wonder if these two checks should not be merge in one checker. Personally I find it cleaner to keep them separate, but I would be happy to combine them if that's wanted. I guessed that it would be easier to

Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-06-02 Thread Murray Cumming via cfe-commits
murrayc updated this revision to Diff 59346. murrayc added a comment. These are the commits amended with the suggested changes. Many thanks for the suggestions. (I'm not quite sure what arcanist will do, so hopefully this will not create a mess.) http://reviews.llvm.org/D20857 Files: clang-

Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-06-01 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. I wonder if these two checks should not be merge in one checker. modernize-explicit-conversion-operator Comment at: clang-tidy/modernize/ExplicitOperatorBoolCheck.cpp:21 @@ +20,3 @@ +void ExplicitOperatorBoolCheck::registerMatchers(MatchFinder *Finde