[PATCH] D14582: [clang-tidy] cppcoreguidelines-pro-bounds-pointer-arithmetic: ignore generated pointer arithmetic

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 12 05:47:09 PST 2015


alexfh added a comment.

It may be more effective to filter out expressions that operate on implicit variables, e.g. by adding this constraint to the binaryOperator matcher:

  unless(hasLHS(ignoringImpCasts(declRefExpr(to(isImplicit())))))

(maybe also for RHS).

The benefit of this would be that it doesn't use hasAncestor/hasDescendant which can be rather expensive.


http://reviews.llvm.org/D14582





More information about the cfe-commits mailing list