File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -782,12 +782,16 @@ std::optional<clang::QualType>
782782GetOperandImplicitConversionTarget (const clang::BinaryOperator *op,
783783 const clang::Expr *operand,
784784 const clang::Expr *sibling) {
785- bool same_type_op = op->isComparisonOp () || op->isAdditiveOp () ||
786- op->isMultiplicativeOp () || op->isBitwiseOp ();
787- if (same_type_op &&
788- NeedsImplicitScalarCast (operand->getType (), sibling->getType ()) &&
789- IsSizeType (sibling->getType ())) {
790- return sibling->getType ();
785+ if (op->isComparisonOp ()) {
786+ if (NeedsImplicitScalarCast (operand->getType (), sibling->getType ()) &&
787+ IsSizeType (sibling->getType ())) {
788+ return sibling->getType ();
789+ }
790+ return std::nullopt ;
791+ }
792+ if ((op->isAdditiveOp () || op->isMultiplicativeOp () || op->isBitwiseOp ()) &&
793+ NeedsImplicitScalarCast (operand->getType (), op->getType ())) {
794+ return op->getType ();
791795 }
792796 return std::nullopt ;
793797}
You can’t perform that action at this time.
0 commit comments