@@ -282,11 +282,13 @@ isInUnspecifiedPointerContext(internal::Matcher<Stmt> InnerMatcher) {
282
282
// 4. the operand of a pointer subtraction operation
283
283
// (i.e., computing the distance between two pointers); or ...
284
284
285
- auto CallArgMatcher =
286
- callExpr (forEachArgumentWithParam (
287
- InnerMatcher,
288
- hasPointerType () /* array also decays to pointer type*/ ),
289
- unless (callee (functionDecl (hasAttr (attr::UnsafeBufferUsage)))));
285
+ // clang-format off
286
+ auto CallArgMatcher = callExpr (
287
+ forEachArgumentWithParamType (
288
+ InnerMatcher,
289
+ isAnyPointer () /* array also decays to pointer type*/ ),
290
+ unless (callee (
291
+ functionDecl (hasAttr (attr::UnsafeBufferUsage)))));
290
292
291
293
auto CastOperandMatcher =
292
294
castExpr (anyOf (hasCastKind (CastKind::CK_PointerToIntegral),
@@ -301,11 +303,14 @@ isInUnspecifiedPointerContext(internal::Matcher<Stmt> InnerMatcher) {
301
303
// A matcher that matches pointer subtractions:
302
304
auto PtrSubtractionMatcher =
303
305
binaryOperator (hasOperatorName (" -" ),
304
- // Note that here we need both LHS and RHS to be
305
- // pointer. Then the inner matcher can match any of
306
- // them:
307
- allOf (hasLHS (hasPointerType ()), hasRHS (hasPointerType ())),
308
- eachOf (hasLHS (InnerMatcher), hasRHS (InnerMatcher)));
306
+ // Note that here we need both LHS and RHS to be
307
+ // pointer. Then the inner matcher can match any of
308
+ // them:
309
+ allOf (hasLHS (hasPointerType ()),
310
+ hasRHS (hasPointerType ())),
311
+ eachOf (hasLHS (InnerMatcher),
312
+ hasRHS (InnerMatcher)));
313
+ // clang-format on
309
314
310
315
return stmt (anyOf (CallArgMatcher, CastOperandMatcher, CompOperandMatcher,
311
316
PtrSubtractionMatcher));
0 commit comments