[PATCH] D24349: [clang-tidy] Extend readability-container-size-empty to arbitrary class with size() and empty()

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 13 01:44:50 PDT 2016


alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

LG


================
Comment at: clang-tidy/readability/ContainerSizeEmptyCheck.cpp:35
@@ +34,3 @@
+                                  hasName("size"), returns(isInteger()),
+                                  unless(returns(booleanType())))
+                        .bind("size")),
----------------
You could probably combine the two `returns` matchers. Something like this: `returns(qualType(isInteger(), unless(booleanType())))`.


https://reviews.llvm.org/D24349





More information about the cfe-commits mailing list