@@ -1509,7 +1509,7 @@ static QualType handleFixedPointConversion(Sema &S, QualType LHSTy,
15091509/// expressions that might be of enumeration type.
15101510void Sema::checkEnumArithmeticConversions(Expr *LHS, Expr *RHS,
15111511 SourceLocation Loc,
1512- Sema:: ArithConvKind ACK) {
1512+ ArithConvKind ACK) {
15131513 // C++2a [expr.arith.conv]p1:
15141514 // If one operand is of enumeration type and the other operand is of a
15151515 // different enumeration type or a floating-point type, this behavior is
@@ -1521,7 +1521,7 @@ void Sema::checkEnumArithmeticConversions(Expr *LHS, Expr *RHS,
15211521 R = RHS->getEnumCoercedType(Context);
15221522 bool LEnum = L->isUnscopedEnumerationType(),
15231523 REnum = R->isUnscopedEnumerationType();
1524- bool IsCompAssign = ACK == Sema::ACK_CompAssign ;
1524+ bool IsCompAssign = ACK == ArithConvKind::CompAssign ;
15251525 if ((!IsCompAssign && LEnum && R->isFloatingType()) ||
15261526 (REnum && L->isFloatingType())) {
15271527 Diag(Loc, getLangOpts().CPlusPlus26 ? diag::err_arith_conv_enum_float_cxx26
@@ -1545,13 +1545,13 @@ void Sema::checkEnumArithmeticConversions(Expr *LHS, Expr *RHS,
15451545 DiagID = getLangOpts().CPlusPlus20
15461546 ? diag::warn_arith_conv_mixed_anon_enum_types_cxx20
15471547 : diag::warn_arith_conv_mixed_anon_enum_types;
1548- } else if (ACK == Sema::ACK_Conditional ) {
1548+ } else if (ACK == ArithConvKind::Conditional ) {
15491549 // Conditional expressions are separated out because they have
15501550 // historically had a different warning flag.
15511551 DiagID = getLangOpts().CPlusPlus20
15521552 ? diag::warn_conditional_mixed_enum_types_cxx20
15531553 : diag::warn_conditional_mixed_enum_types;
1554- } else if (ACK == Sema::ACK_Comparison ) {
1554+ } else if (ACK == ArithConvKind::Comparison ) {
15551555 // Comparison expressions are separated out because they have
15561556 // historically had a different warning flag.
15571557 DiagID = getLangOpts().CPlusPlus20
@@ -1576,7 +1576,7 @@ QualType Sema::UsualArithmeticConversions(ExprResult &LHS, ExprResult &RHS,
15761576 ArithConvKind ACK) {
15771577 checkEnumArithmeticConversions(LHS.get(), RHS.get(), Loc, ACK);
15781578
1579- if (ACK != ACK_CompAssign ) {
1579+ if (ACK != ArithConvKind::CompAssign ) {
15801580 LHS = UsualUnaryConversions(LHS.get());
15811581 if (LHS.isInvalid())
15821582 return QualType();
@@ -1611,7 +1611,7 @@ QualType Sema::UsualArithmeticConversions(ExprResult &LHS, ExprResult &RHS,
16111611 QualType LHSBitfieldPromoteTy = Context.isPromotableBitField(LHS.get());
16121612 if (!LHSBitfieldPromoteTy.isNull())
16131613 LHSType = LHSBitfieldPromoteTy;
1614- if (LHSType != LHSUnpromotedType && ACK != ACK_CompAssign )
1614+ if (LHSType != LHSUnpromotedType && ACK != ArithConvKind::CompAssign )
16151615 LHS = ImpCastExprToType(LHS.get(), LHSType, CK_IntegralCast);
16161616
16171617 // If both types are identical, no conversion is needed.
@@ -1628,24 +1628,24 @@ QualType Sema::UsualArithmeticConversions(ExprResult &LHS, ExprResult &RHS,
16281628 // Handle complex types first (C99 6.3.1.8p1).
16291629 if (LHSType->isComplexType() || RHSType->isComplexType())
16301630 return handleComplexConversion(*this, LHS, RHS, LHSType, RHSType,
1631- ACK == ACK_CompAssign );
1631+ ACK == ArithConvKind::CompAssign );
16321632
16331633 // Now handle "real" floating types (i.e. float, double, long double).
16341634 if (LHSType->isRealFloatingType() || RHSType->isRealFloatingType())
16351635 return handleFloatConversion(*this, LHS, RHS, LHSType, RHSType,
1636- ACK == ACK_CompAssign );
1636+ ACK == ArithConvKind::CompAssign );
16371637
16381638 // Handle GCC complex int extension.
16391639 if (LHSType->isComplexIntegerType() || RHSType->isComplexIntegerType())
16401640 return handleComplexIntConversion(*this, LHS, RHS, LHSType, RHSType,
1641- ACK == ACK_CompAssign );
1641+ ACK == ArithConvKind::CompAssign );
16421642
16431643 if (LHSType->isFixedPointType() || RHSType->isFixedPointType())
16441644 return handleFixedPointConversion(*this, LHSType, RHSType);
16451645
16461646 // Finally, we have two differing integer types.
1647- return handleIntegerConversion<doIntegralCast, doIntegralCast>
1648- ( *this, LHS, RHS, LHSType, RHSType, ACK == ACK_CompAssign );
1647+ return handleIntegerConversion<doIntegralCast, doIntegralCast>(
1648+ *this, LHS, RHS, LHSType, RHSType, ACK == ArithConvKind::CompAssign );
16491649}
16501650
16511651//===----------------------------------------------------------------------===//
@@ -8537,8 +8537,8 @@ QualType Sema::CheckConditionalOperands(ExprResult &Cond, ExprResult &LHS,
85378537 /*AllowBooleanOperation*/ false,
85388538 /*ReportInvalid*/ true);
85398539
8540- QualType ResTy =
8541- UsualArithmeticConversions(LHS, RHS, QuestionLoc, ACK_Conditional );
8540+ QualType ResTy = UsualArithmeticConversions(LHS, RHS, QuestionLoc,
8541+ ArithConvKind::Conditional );
85428542 if (LHS.isInvalid() || RHS.isInvalid())
85438543 return QualType();
85448544
@@ -10521,7 +10521,7 @@ QualType Sema::CheckSizelessVectorOperands(ExprResult &LHS, ExprResult &RHS,
1052110521 const BuiltinType *RHSBuiltinTy = RHSType->getAs<BuiltinType>();
1052210522
1052310523 unsigned DiagID = diag::err_typecheck_invalid_operands;
10524- if ((OperationKind == ACK_Arithmetic ) &&
10524+ if ((OperationKind == ArithConvKind::Arithmetic ) &&
1052510525 ((LHSBuiltinTy && LHSBuiltinTy->isSVEBool()) ||
1052610526 (RHSBuiltinTy && RHSBuiltinTy->isSVEBool()))) {
1052710527 Diag(Loc, DiagID) << LHSType << RHSType << LHS.get()->getSourceRange()
@@ -10730,7 +10730,7 @@ QualType Sema::CheckMultiplyDivideOperands(ExprResult &LHS, ExprResult &RHS,
1073010730 /*ReportInvalid*/ true);
1073110731 if (LHSTy->isSveVLSBuiltinType() || RHSTy->isSveVLSBuiltinType())
1073210732 return CheckSizelessVectorOperands(LHS, RHS, Loc, IsCompAssign,
10733- ACK_Arithmetic );
10733+ ArithConvKind::Arithmetic );
1073410734 if (!IsDiv &&
1073510735 (LHSTy->isConstantMatrixType() || RHSTy->isConstantMatrixType()))
1073610736 return CheckMatrixMultiplyOperands(LHS, RHS, Loc, IsCompAssign);
@@ -10740,7 +10740,8 @@ QualType Sema::CheckMultiplyDivideOperands(ExprResult &LHS, ExprResult &RHS,
1074010740 return CheckMatrixElementwiseOperands(LHS, RHS, Loc, IsCompAssign);
1074110741
1074210742 QualType compType = UsualArithmeticConversions(
10743- LHS, RHS, Loc, IsCompAssign ? ACK_CompAssign : ACK_Arithmetic);
10743+ LHS, RHS, Loc,
10744+ IsCompAssign ? ArithConvKind::CompAssign : ArithConvKind::Arithmetic);
1074410745 if (LHS.isInvalid() || RHS.isInvalid())
1074510746 return QualType();
1074610747
@@ -10796,13 +10797,14 @@ QualType Sema::CheckRemainderOperands(
1079610797 if (LHS.get()->getType()->hasIntegerRepresentation() &&
1079710798 RHS.get()->getType()->hasIntegerRepresentation())
1079810799 return CheckSizelessVectorOperands(LHS, RHS, Loc, IsCompAssign,
10799- ACK_Arithmetic );
10800+ ArithConvKind::Arithmetic );
1080010801
1080110802 return InvalidOperands(Loc, LHS, RHS);
1080210803 }
1080310804
1080410805 QualType compType = UsualArithmeticConversions(
10805- LHS, RHS, Loc, IsCompAssign ? ACK_CompAssign : ACK_Arithmetic);
10806+ LHS, RHS, Loc,
10807+ IsCompAssign ? ArithConvKind::CompAssign : ArithConvKind::Arithmetic);
1080610808 if (LHS.isInvalid() || RHS.isInvalid())
1080710809 return QualType();
1080810810
@@ -11115,8 +11117,8 @@ QualType Sema::CheckAdditionOperands(ExprResult &LHS, ExprResult &RHS,
1111511117
1111611118 if (LHS.get()->getType()->isSveVLSBuiltinType() ||
1111711119 RHS.get()->getType()->isSveVLSBuiltinType()) {
11118- QualType compType =
11119- CheckSizelessVectorOperands(LHS, RHS, Loc, CompLHSTy, ACK_Arithmetic );
11120+ QualType compType = CheckSizelessVectorOperands(LHS, RHS, Loc, CompLHSTy,
11121+ ArithConvKind::Arithmetic );
1112011122 if (CompLHSTy)
1112111123 *CompLHSTy = compType;
1112211124 return compType;
@@ -11132,7 +11134,8 @@ QualType Sema::CheckAdditionOperands(ExprResult &LHS, ExprResult &RHS,
1113211134 }
1113311135
1113411136 QualType compType = UsualArithmeticConversions(
11135- LHS, RHS, Loc, CompLHSTy ? ACK_CompAssign : ACK_Arithmetic);
11137+ LHS, RHS, Loc,
11138+ CompLHSTy ? ArithConvKind::CompAssign : ArithConvKind::Arithmetic);
1113611139 if (LHS.isInvalid() || RHS.isInvalid())
1113711140 return QualType();
1113811141
@@ -11238,8 +11241,8 @@ QualType Sema::CheckSubtractionOperands(ExprResult &LHS, ExprResult &RHS,
1123811241
1123911242 if (LHS.get()->getType()->isSveVLSBuiltinType() ||
1124011243 RHS.get()->getType()->isSveVLSBuiltinType()) {
11241- QualType compType =
11242- CheckSizelessVectorOperands(LHS, RHS, Loc, CompLHSTy, ACK_Arithmetic );
11244+ QualType compType = CheckSizelessVectorOperands(LHS, RHS, Loc, CompLHSTy,
11245+ ArithConvKind::Arithmetic );
1124311246 if (CompLHSTy)
1124411247 *CompLHSTy = compType;
1124511248 return compType;
@@ -11255,7 +11258,8 @@ QualType Sema::CheckSubtractionOperands(ExprResult &LHS, ExprResult &RHS,
1125511258 }
1125611259
1125711260 QualType compType = UsualArithmeticConversions(
11258- LHS, RHS, Loc, CompLHSTy ? ACK_CompAssign : ACK_Arithmetic);
11261+ LHS, RHS, Loc,
11262+ CompLHSTy ? ArithConvKind::CompAssign : ArithConvKind::Arithmetic);
1125911263 if (LHS.isInvalid() || RHS.isInvalid())
1126011264 return QualType();
1126111265
@@ -12277,7 +12281,7 @@ static QualType checkArithmeticOrEnumeralThreeWayCompare(Sema &S,
1227712281 // C++2a [expr.spaceship]p4: If both operands have arithmetic types, the
1227812282 // usual arithmetic conversions are applied to the operands.
1227912283 QualType Type =
12280- S.UsualArithmeticConversions(LHS, RHS, Loc, Sema::ACK_Comparison );
12284+ S.UsualArithmeticConversions(LHS, RHS, Loc, ArithConvKind::Comparison );
1228112285 if (LHS.isInvalid() || RHS.isInvalid())
1228212286 return QualType();
1228312287 if (Type.isNull())
@@ -12310,7 +12314,7 @@ static QualType checkArithmeticOrEnumeralCompare(Sema &S, ExprResult &LHS,
1231012314
1231112315 // C99 6.5.8p3 / C99 6.5.9p4
1231212316 QualType Type =
12313- S.UsualArithmeticConversions(LHS, RHS, Loc, Sema::ACK_Comparison );
12317+ S.UsualArithmeticConversions(LHS, RHS, Loc, ArithConvKind::Comparison );
1231412318 if (LHS.isInvalid() || RHS.isInvalid())
1231512319 return QualType();
1231612320 if (Type.isNull())
@@ -12972,7 +12976,7 @@ QualType Sema::CheckSizelessVectorCompareOperands(ExprResult &LHS,
1297212976 // Check to make sure we're operating on vectors of the same type and width,
1297312977 // Allowing one side to be a scalar of element type.
1297412978 QualType vType = CheckSizelessVectorOperands(
12975- LHS, RHS, Loc, /*isCompAssign*/ false, ACK_Comparison );
12979+ LHS, RHS, Loc, /*isCompAssign*/ false, ArithConvKind::Comparison );
1297612980
1297712981 if (vType.isNull())
1297812982 return vType;
@@ -13282,7 +13286,7 @@ inline QualType Sema::CheckBitwiseOperands(ExprResult &LHS, ExprResult &RHS,
1328213286 if (LHS.get()->getType()->hasIntegerRepresentation() &&
1328313287 RHS.get()->getType()->hasIntegerRepresentation())
1328413288 return CheckSizelessVectorOperands(LHS, RHS, Loc, IsCompAssign,
13285- ACK_BitwiseOp );
13289+ ArithConvKind::BitwiseOp );
1328613290 return InvalidOperands(Loc, LHS, RHS);
1328713291 }
1328813292
@@ -13291,7 +13295,7 @@ inline QualType Sema::CheckBitwiseOperands(ExprResult &LHS, ExprResult &RHS,
1329113295 if (LHS.get()->getType()->hasIntegerRepresentation() &&
1329213296 RHS.get()->getType()->hasIntegerRepresentation())
1329313297 return CheckSizelessVectorOperands(LHS, RHS, Loc, IsCompAssign,
13294- ACK_BitwiseOp );
13298+ ArithConvKind::BitwiseOp );
1329513299 return InvalidOperands(Loc, LHS, RHS);
1329613300 }
1329713301
@@ -13304,7 +13308,8 @@ inline QualType Sema::CheckBitwiseOperands(ExprResult &LHS, ExprResult &RHS,
1330413308
1330513309 ExprResult LHSResult = LHS, RHSResult = RHS;
1330613310 QualType compType = UsualArithmeticConversions(
13307- LHSResult, RHSResult, Loc, IsCompAssign ? ACK_CompAssign : ACK_BitwiseOp);
13311+ LHSResult, RHSResult, Loc,
13312+ IsCompAssign ? ArithConvKind::CompAssign : ArithConvKind::BitwiseOp);
1330813313 if (LHSResult.isInvalid() || RHSResult.isInvalid())
1330913314 return QualType();
1331013315 LHS = LHSResult.get();
0 commit comments