[PATCH] D19014: [clang-tidy] Add new checker for suspicious sizeof expressions

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 12 13:03:26 PDT 2016


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

Looks good with one more nit. I'm not sure what to do with `hasSizeOfAncestor`, we can leave it as is for now.


================
Comment at: clang-tidy/misc/SizeofExpressionCheck.cpp:47
@@ +46,3 @@
+      isa<ParenExpr>(E)) {
+    ast_matchers::internal::Matcher<Expr> M = hasSizeOfAncestor(InnerMatcher);
+    return M.matches(*E, Finder, Builder);
----------------
The type here doesn't help, I'd use `auto`.


http://reviews.llvm.org/D19014





More information about the cfe-commits mailing list