summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
diff options
context:
space:
mode:
authorMandeep Singh Grang <mgrang@codeaurora.org>2016-11-08 07:50:19 +0000
committerMandeep Singh Grang <mgrang@codeaurora.org>2016-11-08 07:50:19 +0000
commit7c7ea7d0ae4041e92a4d510874e78da9f5e3bc1c (patch)
tree58745ba1b5123ed61711bbf23879bf5350c74e81 /clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
parentd700c357d4689abb48121f61690a4080e39c326d (diff)
downloadbcm5719-llvm-7c7ea7d0ae4041e92a4d510874e78da9f5e3bc1c.tar.gz
bcm5719-llvm-7c7ea7d0ae4041e92a4d510874e78da9f5e3bc1c.zip
[clang-tools-extra] Format sources with clang-format. NFC.
Summary: Ran clang-format on all .c/.cpp/.h files in clang-tools-extra. Excluded the test, unittests, clang-reorder-fields, include-fixer, modularize and pptrace directories. Reviewers: klimek, alexfh Subscribers: nemanjai Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D26329 llvm-svn: 286221
Diffstat (limited to 'clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
index 56fbf742f63..3844f68ed15 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
@@ -47,12 +47,12 @@ void ProBoundsConstantArrayIndexCheck::registerMatchers(MatchFinder *Finder) {
// Note: if a struct contains an array member, the compiler-generated
// constructor has an arraySubscriptExpr.
- Finder->addMatcher(arraySubscriptExpr(hasBase(ignoringImpCasts(hasType(
- constantArrayType().bind("type")))),
- hasIndex(expr().bind("index")),
- unless(hasAncestor(isImplicit())))
- .bind("expr"),
- this);
+ Finder->addMatcher(
+ arraySubscriptExpr(
+ hasBase(ignoringImpCasts(hasType(constantArrayType().bind("type")))),
+ hasIndex(expr().bind("index")), unless(hasAncestor(isImplicit())))
+ .bind("expr"),
+ this);
Finder->addMatcher(
cxxOperatorCallExpr(
@@ -112,8 +112,7 @@ void ProBoundsConstantArrayIndexCheck::check(
return;
if (Index.isSigned() && Index.isNegative()) {
- diag(Matched->getExprLoc(),
- "std::array<> index %0 is negative")
+ diag(Matched->getExprLoc(), "std::array<> index %0 is negative")
<< Index.toString(10);
return;
}
@@ -130,8 +129,9 @@ void ProBoundsConstantArrayIndexCheck::check(
// Get uint64_t values, because different bitwidths would lead to an assertion
// in APInt::uge.
if (Index.getZExtValue() >= ArraySize.getZExtValue()) {
- diag(Matched->getExprLoc(), "std::array<> index %0 is past the end of the array "
- "(which contains %1 elements)")
+ diag(Matched->getExprLoc(),
+ "std::array<> index %0 is past the end of the array "
+ "(which contains %1 elements)")
<< Index.toString(10) << ArraySize.toString(10, false);
}
}
OpenPOWER on IntegriCloud