summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-array-to-pointer-decay.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] fix PR39583 - ignoring ParenCast for string-literals in ↵Jonas Toth2018-11-091-0/+4
| | | | | | | | | | | | | | | | | | | pro-bounds-array-to-pointer-decay Summary: The fix to the issue that `const char* p = ("foo")` is diagnosed as decay is to ignored the ParenCast. Resolves PR39583 Reviewers: aaron.ballman, alexfh, hokein Reviewed By: aaron.ballman Subscribers: nemanjai, xazax.hun, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D54281 llvm-svn: 346555
* Reverting r298421 due to using a header that's unavailable to all systems ↵Aaron Ballman2017-03-221-6/+0
| | | | | | and some other post-commit review feedback. llvm-svn: 298470
* Prevent cppcoreguidelines-pro-bounds-array-to-pointer-decay from diagnosing ↵Aaron Ballman2017-03-211-0/+6
| | | | | | | | array to pointer decay stemming from system macros. Patch by Breno Rodrigues Guimaraes. llvm-svn: 298421
* Fix bug 25362 "cppcoreguidelines-pro-bounds-array-to-pointer-decay does not ↵Matthias Gehre2015-11-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | consider const" Summary: The current matcher is implicitCastExpr(unless(hasParent(explicitCastExpr()))) but the AST in the bug is `-CXXStaticCastExpr 0x2bb64f8 <col:21, col:55> 'void *const *' static_cast<void *const *> <NoOp> `-ImplicitCastExpr 0x2bb64e0 <col:47> 'void *const *' <NoOp> `-ImplicitCastExpr 0x2bb64c8 <col:47> 'void **' <ArrayToPointerDecay> `-DeclRefExpr 0x2bb6458 <col:47> 'void *[2]' lvalue Var 0x2bb59d0 'addrlist' 'void *[2]' i.e. an ImplicitCastExpr (const cast) between decay and explicit cast. Reviewers: alexfh, sbenza, bkramer, aaron.ballman Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D14517 llvm-svn: 253399
* [clang-tidy] Add new check cppcoreguidelines-pro-bounds-array-to-pointer-decayMatthias Gehre2015-10-261-0/+41
Summary: This check flags all array to pointer decays. Pointers should not be used as arrays. array_view is a bounds-checked, safe alternative to using pointers to access arrays. This rule is part of the "Bounds safety" profile of the C++ Core Guidelines, see https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#-bounds3-no-array-to-pointer-decay Reviewers: alexfh, sbenza, bkramer, aaron.ballman Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D13640 llvm-svn: 251358
OpenPOWER on IntegriCloud