================
@@ -10772,9 +10811,14 @@ QualType Sema::CheckMultiplyDivideOperands(ExprResult
&LHS, ExprResult &RHS,
if (LHS.isInvalid() || RHS.isInvalid())
return QualType();
-
- if (compType.isNull() || !compType->isArithmeticType())
- return InvalidOperands(Loc, LHS, RHS);
+ if (compType.isNull() || !compType->isArithmeticType()) {
+ InvalidOperands(Loc, LHS, RHS);
+ diagnoseScopedEnums(*this, Loc, LHS, RHS,
+ IsCompAssign ? IsDiv ? BO_DivAssign : BO_MulAssign
+ : IsDiv ? BO_Div
+ : BO_Mul);
----------------
tinnamchoi wrote:
Would it be acceptable to change `CheckMultiplyDivideOperands` to take
`BinaryOperatorKind Opc` instead of `bool IsCompAssign, bool IsDiv`? It should
be even cleaner but I was trying to avoid changing existing function
signatures. A lot of these `Check[Operation]Operands` functions have similar
inconsistencies where sometimes they take a `BinaryOperatorKind`, `bool`s, or
nothing at all. Maybe this can do with a bit of refactoring in the future.
https://github.com/llvm/llvm-project/pull/152698
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits