diff options
author | Matthias Gehre <M.Gehre@gmx.de> | 2015-11-26 22:32:11 +0000 |
---|---|---|
committer | Matthias Gehre <M.Gehre@gmx.de> | 2015-11-26 22:32:11 +0000 |
commit | 4241cedb68d61d85dd12b64d6792d0277f9ff4b2 (patch) | |
tree | 0d2d5095e679f02f58253ff9bb674d137eaeeebb /clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic.cpp | |
parent | 2a3ca840e34ea49a96932b822bf772b8d9ec6bec (diff) | |
download | bcm5719-llvm-4241cedb68d61d85dd12b64d6792d0277f9ff4b2.tar.gz bcm5719-llvm-4241cedb68d61d85dd12b64d6792d0277f9ff4b2.zip |
[clang-tidy] cppcoreguidelines-pro-bounds-pointer-arithmetic: ignore generated pointer arithmetic
Summary:
Inside a range-based for-loop over an array, the compiler
generates pointer arithmetic (end = array + size). Don't flag this.
Reviewers: alexfh, sbenza, bkramer, aaron.ballman
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D14582
llvm-svn: 254182
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic.cpp')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic.cpp b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic.cpp index c8fea8052e5..7cbc6ddf96a 100644 --- a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic.cpp +++ b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic.cpp @@ -84,4 +84,6 @@ void okay() { i = j - 1; auto diff = p - q; // OK, result is arithmetic + + for(int ii : a) ; // OK, pointer arithmetic generated by compiler } |