From 7c7ea7d0ae4041e92a4d510874e78da9f5e3bc1c Mon Sep 17 00:00:00 2001 From: Mandeep Singh Grang Date: Tue, 8 Nov 2016 07:50:19 +0000 Subject: [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 --- .../ProBoundsConstantArrayIndexCheck.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp') 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); } } -- cgit v1.2.3