================ @@ -306,8 +310,13 @@ void SizeofExpressionCheck::registerMatchers(MatchFinder *Finder) { unaryExprOrTypeTraitExpr(ofKind(UETT_AlignOf)), offsetOfExpr())) .bind("sizeof-in-ptr-arithmetic-scale-expr"); + const auto PtrArithmeticIntegerScaleExprInterestingOperatorNames = [this] { + if (WarnOnSizeOfPointerArithmeticWithDivisionScaled) + return binaryOperator(hasAnyOperatorName("*", "/")); + return binaryOperator(hasOperatorName("*")); + }; ---------------- nicovank wrote:
```suggestion const auto HasSoughtIntegerScaleExprOperatorName = WarnOnSizeOfPointerArithmeticWithDivisionScaled ? binaryOperator(hasAnyOperatorName("*", "/")) : binaryOperator(hasOperatorName("*")); ``` Ternary should be OK, and I find name a little long but nit. https://github.com/llvm/llvm-project/pull/111178 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits