summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [ClangTidy] Separate tests for infrastructure and checkersDmitri Gribenko2019-10-111-89/+0
| | | | | | | | | | | | | | | | | | | | Summary: This change moves tests for checkers and infrastructure into separate directories, making it easier to find infrastructure tests. Tests for checkers are already easy to find because they are named after the checker. Tests for infrastructure were difficult to find because they were outnumbered by tests for checkers. Now they are in a separate directory. Reviewers: jfb, jdoerfert, lebedev.ri Subscribers: srhines, nemanjai, aheejin, kbarton, christof, mgrang, arphaman, jfb, lebedev.ri, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68807 llvm-svn: 374540
* Revert "[clang-tidy] fix PR36489 - respect deduced pointer types from auto ↵Jonas Toth2018-07-231-28/+1
| | | | | | | | as well" I applied the wrong patch. llvm-svn: 337712
* [clang-tidy] fix PR36489 - respect deduced pointer types from auto as wellJonas Toth2018-07-231-1/+28
| | | | | | | | | | | | | | | | | | Summary: The cppcoreguidelines-pro-bounds-pointer-arithmetic warns on all occassion where pointer arithmetic is used, but does not check values where the pointer types is deduced via ``auto``. This patch adjusts this behaviour and solved PR36489. Reviewers: alexfh, aaron.ballman, hokein, ilya-biryukov Reviewed By: alexfh, aaron.ballman Subscribers: nemanjai, xazax.hun, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D48717 llvm-svn: 337710
* [clang-tidy] cppcoreguidelines-pro-bounds-pointer-arithmetic: ignore ↵Matthias Gehre2015-11-261-0/+2
| | | | | | | | | | | | | | | | 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
* Add %check_clang_tidy and %clang_tidy_diff.Manuel Klimek2015-10-221-1/+1
| | | | | | | | | | With this, site specific lit configs can inject parameters into the test scripts if they need site specific parameters. Next up: enable check_clang_tidy to take a resource dir to enable non-standard locations for builtin includes. llvm-svn: 251010
* [clang-tidy] new check cppcoreguidelines-pro-bounds-pointer-arithmeticMatthias Gehre2015-10-121-0/+87
Summary: This check flags all usage of pointer arithmetic, because it could lead to an invalid pointer. Subtraction of two pointers is not flagged by this check. Pointers should only refer to single objects, and pointer arithmetic is fragile and easy to get wrong. array_view is a bounds-checked, safe type for accessing arrays of data. This rule is part of the "Bounds safety" profile of the C++ Core Guidelines, see https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#-bounds1-dont-use-pointer-arithmetic-use-array_view-instead Depends on D13313 Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D13311 llvm-svn: 250116
OpenPOWER on IntegriCloud