aaron.ballman added inline comments. ================ Comment at: clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp:48 @@ +47,3 @@ + diag(MatchedExpr->getExprLoc(), + "do not use pointer arithmetic (C++ Core Guidelines, rule Bounds.1)"); +} ---------------- Can elide the parenthetical.
================ Comment at: clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h:18 @@ +17,3 @@ + +/// Flags all kinds of pointer arithmetic +/// ---------------- This could be a bit more usefully descriptive. ;-) ================ Comment at: test/clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic.cpp:36 @@ +35,3 @@ + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: do not use pointer arithmetic (C++ Core Guidelines, rule Bounds.1) [cppcoreguidelines-pro-bounds-pointer-arithmetic] +} + ---------------- How does this check handle code like: ``` struct S { operator int() const; }; void f(S &s) { int *i; i = i + s; } ``` ================ Comment at: test/clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic.cpp:38 @@ +37,3 @@ + +void okey() { + int a[3]; ---------------- s/okey/okay ;-) http://reviews.llvm.org/D13311 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits