summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.h
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [clang-tidy] remove trailing whitespaces and retabKirill Bobyrev2016-08-011-1/+1
| | | | llvm-svn: 277340
* [clang-tidy] Cleaning namespaces to be more consistant across checkers.Etienne Bergeron2016-05-021-1/+3
| | | | | | | | | | | | | | Summary: The goal of the patch is to bring checkers in their appropriate namespace. This path doesn't change any behavior. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19811 llvm-svn: 268264
* Fix bug 25362 "cppcoreguidelines-pro-bounds-array-to-pointer-decay does not ↵Matthias Gehre2015-11-171-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | 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/+34
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