[PATCH] D16308: clang-tidy Enhance readability-simplify-boolean-expr check to handle implicit conversions of integral types to bool and member pointers

Richard via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 20 09:13:31 PST 2016


LegalizeAdulthood added inline comments.

================
Comment at: docs/clang-tidy/checks/readability-simplify-boolean-expr.rst:59
@@ -56,3 +58,3 @@
 
   4. The conditional return ``if (p) return true; return false;`` has an
      implicit conversion of a pointer to ``bool`` and becomes
----------------
aaron.ballman wrote:
> Update for member pointers.
Do I really need to explicitly say member pointer as well?  It seems redundant.

I didn't update it because a pointer to a member is a pointer.  When used as an implicit conversion to `bool`, the syntax is no different for a plain pointer than for a member pointer.  If the syntax were different, I could see your point.



http://reviews.llvm.org/D16308





More information about the cfe-commits mailing list