@@ -1509,7 +1509,7 @@ static QualType handleFixedPointConversion(Sema &S, QualType LHSTy,
1509
1509
/// expressions that might be of enumeration type.
1510
1510
void Sema::checkEnumArithmeticConversions(Expr *LHS, Expr *RHS,
1511
1511
SourceLocation Loc,
1512
- Sema:: ArithConvKind ACK) {
1512
+ ArithConvKind ACK) {
1513
1513
// C++2a [expr.arith.conv]p1:
1514
1514
// If one operand is of enumeration type and the other operand is of a
1515
1515
// different enumeration type or a floating-point type, this behavior is
@@ -1521,7 +1521,7 @@ void Sema::checkEnumArithmeticConversions(Expr *LHS, Expr *RHS,
1521
1521
R = RHS->getEnumCoercedType(Context);
1522
1522
bool LEnum = L->isUnscopedEnumerationType(),
1523
1523
REnum = R->isUnscopedEnumerationType();
1524
- bool IsCompAssign = ACK == Sema::ACK_CompAssign ;
1524
+ bool IsCompAssign = ACK == ArithConvKind::CompAssign ;
1525
1525
if ((!IsCompAssign && LEnum && R->isFloatingType()) ||
1526
1526
(REnum && L->isFloatingType())) {
1527
1527
Diag(Loc, getLangOpts().CPlusPlus26 ? diag::err_arith_conv_enum_float_cxx26
@@ -1545,13 +1545,13 @@ void Sema::checkEnumArithmeticConversions(Expr *LHS, Expr *RHS,
1545
1545
DiagID = getLangOpts().CPlusPlus20
1546
1546
? diag::warn_arith_conv_mixed_anon_enum_types_cxx20
1547
1547
: diag::warn_arith_conv_mixed_anon_enum_types;
1548
- } else if (ACK == Sema::ACK_Conditional ) {
1548
+ } else if (ACK == ArithConvKind::Conditional ) {
1549
1549
// Conditional expressions are separated out because they have
1550
1550
// historically had a different warning flag.
1551
1551
DiagID = getLangOpts().CPlusPlus20
1552
1552
? diag::warn_conditional_mixed_enum_types_cxx20
1553
1553
: diag::warn_conditional_mixed_enum_types;
1554
- } else if (ACK == Sema::ACK_Comparison ) {
1554
+ } else if (ACK == ArithConvKind::Comparison ) {
1555
1555
// Comparison expressions are separated out because they have
1556
1556
// historically had a different warning flag.
1557
1557
DiagID = getLangOpts().CPlusPlus20
@@ -1576,7 +1576,7 @@ QualType Sema::UsualArithmeticConversions(ExprResult &LHS, ExprResult &RHS,
1576
1576
ArithConvKind ACK) {
1577
1577
checkEnumArithmeticConversions(LHS.get(), RHS.get(), Loc, ACK);
1578
1578
1579
- if (ACK != ACK_CompAssign ) {
1579
+ if (ACK != ArithConvKind::CompAssign ) {
1580
1580
LHS = UsualUnaryConversions(LHS.get());
1581
1581
if (LHS.isInvalid())
1582
1582
return QualType();
@@ -1611,7 +1611,7 @@ QualType Sema::UsualArithmeticConversions(ExprResult &LHS, ExprResult &RHS,
1611
1611
QualType LHSBitfieldPromoteTy = Context.isPromotableBitField(LHS.get());
1612
1612
if (!LHSBitfieldPromoteTy.isNull())
1613
1613
LHSType = LHSBitfieldPromoteTy;
1614
- if (LHSType != LHSUnpromotedType && ACK != ACK_CompAssign )
1614
+ if (LHSType != LHSUnpromotedType && ACK != ArithConvKind::CompAssign )
1615
1615
LHS = ImpCastExprToType(LHS.get(), LHSType, CK_IntegralCast);
1616
1616
1617
1617
// If both types are identical, no conversion is needed.
@@ -1628,24 +1628,24 @@ QualType Sema::UsualArithmeticConversions(ExprResult &LHS, ExprResult &RHS,
1628
1628
// Handle complex types first (C99 6.3.1.8p1).
1629
1629
if (LHSType->isComplexType() || RHSType->isComplexType())
1630
1630
return handleComplexConversion(*this, LHS, RHS, LHSType, RHSType,
1631
- ACK == ACK_CompAssign );
1631
+ ACK == ArithConvKind::CompAssign );
1632
1632
1633
1633
// Now handle "real" floating types (i.e. float, double, long double).
1634
1634
if (LHSType->isRealFloatingType() || RHSType->isRealFloatingType())
1635
1635
return handleFloatConversion(*this, LHS, RHS, LHSType, RHSType,
1636
- ACK == ACK_CompAssign );
1636
+ ACK == ArithConvKind::CompAssign );
1637
1637
1638
1638
// Handle GCC complex int extension.
1639
1639
if (LHSType->isComplexIntegerType() || RHSType->isComplexIntegerType())
1640
1640
return handleComplexIntConversion(*this, LHS, RHS, LHSType, RHSType,
1641
- ACK == ACK_CompAssign );
1641
+ ACK == ArithConvKind::CompAssign );
1642
1642
1643
1643
if (LHSType->isFixedPointType() || RHSType->isFixedPointType())
1644
1644
return handleFixedPointConversion(*this, LHSType, RHSType);
1645
1645
1646
1646
// 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 );
1649
1649
}
1650
1650
1651
1651
//===----------------------------------------------------------------------===//
@@ -8537,8 +8537,8 @@ QualType Sema::CheckConditionalOperands(ExprResult &Cond, ExprResult &LHS,
8537
8537
/*AllowBooleanOperation*/ false,
8538
8538
/*ReportInvalid*/ true);
8539
8539
8540
- QualType ResTy =
8541
- UsualArithmeticConversions(LHS, RHS, QuestionLoc, ACK_Conditional );
8540
+ QualType ResTy = UsualArithmeticConversions(LHS, RHS, QuestionLoc,
8541
+ ArithConvKind::Conditional );
8542
8542
if (LHS.isInvalid() || RHS.isInvalid())
8543
8543
return QualType();
8544
8544
@@ -10521,7 +10521,7 @@ QualType Sema::CheckSizelessVectorOperands(ExprResult &LHS, ExprResult &RHS,
10521
10521
const BuiltinType *RHSBuiltinTy = RHSType->getAs<BuiltinType>();
10522
10522
10523
10523
unsigned DiagID = diag::err_typecheck_invalid_operands;
10524
- if ((OperationKind == ACK_Arithmetic ) &&
10524
+ if ((OperationKind == ArithConvKind::Arithmetic ) &&
10525
10525
((LHSBuiltinTy && LHSBuiltinTy->isSVEBool()) ||
10526
10526
(RHSBuiltinTy && RHSBuiltinTy->isSVEBool()))) {
10527
10527
Diag(Loc, DiagID) << LHSType << RHSType << LHS.get()->getSourceRange()
@@ -10730,7 +10730,7 @@ QualType Sema::CheckMultiplyDivideOperands(ExprResult &LHS, ExprResult &RHS,
10730
10730
/*ReportInvalid*/ true);
10731
10731
if (LHSTy->isSveVLSBuiltinType() || RHSTy->isSveVLSBuiltinType())
10732
10732
return CheckSizelessVectorOperands(LHS, RHS, Loc, IsCompAssign,
10733
- ACK_Arithmetic );
10733
+ ArithConvKind::Arithmetic );
10734
10734
if (!IsDiv &&
10735
10735
(LHSTy->isConstantMatrixType() || RHSTy->isConstantMatrixType()))
10736
10736
return CheckMatrixMultiplyOperands(LHS, RHS, Loc, IsCompAssign);
@@ -10740,7 +10740,8 @@ QualType Sema::CheckMultiplyDivideOperands(ExprResult &LHS, ExprResult &RHS,
10740
10740
return CheckMatrixElementwiseOperands(LHS, RHS, Loc, IsCompAssign);
10741
10741
10742
10742
QualType compType = UsualArithmeticConversions(
10743
- LHS, RHS, Loc, IsCompAssign ? ACK_CompAssign : ACK_Arithmetic);
10743
+ LHS, RHS, Loc,
10744
+ IsCompAssign ? ArithConvKind::CompAssign : ArithConvKind::Arithmetic);
10744
10745
if (LHS.isInvalid() || RHS.isInvalid())
10745
10746
return QualType();
10746
10747
@@ -10796,13 +10797,14 @@ QualType Sema::CheckRemainderOperands(
10796
10797
if (LHS.get()->getType()->hasIntegerRepresentation() &&
10797
10798
RHS.get()->getType()->hasIntegerRepresentation())
10798
10799
return CheckSizelessVectorOperands(LHS, RHS, Loc, IsCompAssign,
10799
- ACK_Arithmetic );
10800
+ ArithConvKind::Arithmetic );
10800
10801
10801
10802
return InvalidOperands(Loc, LHS, RHS);
10802
10803
}
10803
10804
10804
10805
QualType compType = UsualArithmeticConversions(
10805
- LHS, RHS, Loc, IsCompAssign ? ACK_CompAssign : ACK_Arithmetic);
10806
+ LHS, RHS, Loc,
10807
+ IsCompAssign ? ArithConvKind::CompAssign : ArithConvKind::Arithmetic);
10806
10808
if (LHS.isInvalid() || RHS.isInvalid())
10807
10809
return QualType();
10808
10810
@@ -11115,8 +11117,8 @@ QualType Sema::CheckAdditionOperands(ExprResult &LHS, ExprResult &RHS,
11115
11117
11116
11118
if (LHS.get()->getType()->isSveVLSBuiltinType() ||
11117
11119
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 );
11120
11122
if (CompLHSTy)
11121
11123
*CompLHSTy = compType;
11122
11124
return compType;
@@ -11132,7 +11134,8 @@ QualType Sema::CheckAdditionOperands(ExprResult &LHS, ExprResult &RHS,
11132
11134
}
11133
11135
11134
11136
QualType compType = UsualArithmeticConversions(
11135
- LHS, RHS, Loc, CompLHSTy ? ACK_CompAssign : ACK_Arithmetic);
11137
+ LHS, RHS, Loc,
11138
+ CompLHSTy ? ArithConvKind::CompAssign : ArithConvKind::Arithmetic);
11136
11139
if (LHS.isInvalid() || RHS.isInvalid())
11137
11140
return QualType();
11138
11141
@@ -11238,8 +11241,8 @@ QualType Sema::CheckSubtractionOperands(ExprResult &LHS, ExprResult &RHS,
11238
11241
11239
11242
if (LHS.get()->getType()->isSveVLSBuiltinType() ||
11240
11243
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 );
11243
11246
if (CompLHSTy)
11244
11247
*CompLHSTy = compType;
11245
11248
return compType;
@@ -11255,7 +11258,8 @@ QualType Sema::CheckSubtractionOperands(ExprResult &LHS, ExprResult &RHS,
11255
11258
}
11256
11259
11257
11260
QualType compType = UsualArithmeticConversions(
11258
- LHS, RHS, Loc, CompLHSTy ? ACK_CompAssign : ACK_Arithmetic);
11261
+ LHS, RHS, Loc,
11262
+ CompLHSTy ? ArithConvKind::CompAssign : ArithConvKind::Arithmetic);
11259
11263
if (LHS.isInvalid() || RHS.isInvalid())
11260
11264
return QualType();
11261
11265
@@ -12277,7 +12281,7 @@ static QualType checkArithmeticOrEnumeralThreeWayCompare(Sema &S,
12277
12281
// C++2a [expr.spaceship]p4: If both operands have arithmetic types, the
12278
12282
// usual arithmetic conversions are applied to the operands.
12279
12283
QualType Type =
12280
- S.UsualArithmeticConversions(LHS, RHS, Loc, Sema::ACK_Comparison );
12284
+ S.UsualArithmeticConversions(LHS, RHS, Loc, ArithConvKind::Comparison );
12281
12285
if (LHS.isInvalid() || RHS.isInvalid())
12282
12286
return QualType();
12283
12287
if (Type.isNull())
@@ -12310,7 +12314,7 @@ static QualType checkArithmeticOrEnumeralCompare(Sema &S, ExprResult &LHS,
12310
12314
12311
12315
// C99 6.5.8p3 / C99 6.5.9p4
12312
12316
QualType Type =
12313
- S.UsualArithmeticConversions(LHS, RHS, Loc, Sema::ACK_Comparison );
12317
+ S.UsualArithmeticConversions(LHS, RHS, Loc, ArithConvKind::Comparison );
12314
12318
if (LHS.isInvalid() || RHS.isInvalid())
12315
12319
return QualType();
12316
12320
if (Type.isNull())
@@ -12972,7 +12976,7 @@ QualType Sema::CheckSizelessVectorCompareOperands(ExprResult &LHS,
12972
12976
// Check to make sure we're operating on vectors of the same type and width,
12973
12977
// Allowing one side to be a scalar of element type.
12974
12978
QualType vType = CheckSizelessVectorOperands(
12975
- LHS, RHS, Loc, /*isCompAssign*/ false, ACK_Comparison );
12979
+ LHS, RHS, Loc, /*isCompAssign*/ false, ArithConvKind::Comparison );
12976
12980
12977
12981
if (vType.isNull())
12978
12982
return vType;
@@ -13282,7 +13286,7 @@ inline QualType Sema::CheckBitwiseOperands(ExprResult &LHS, ExprResult &RHS,
13282
13286
if (LHS.get()->getType()->hasIntegerRepresentation() &&
13283
13287
RHS.get()->getType()->hasIntegerRepresentation())
13284
13288
return CheckSizelessVectorOperands(LHS, RHS, Loc, IsCompAssign,
13285
- ACK_BitwiseOp );
13289
+ ArithConvKind::BitwiseOp );
13286
13290
return InvalidOperands(Loc, LHS, RHS);
13287
13291
}
13288
13292
@@ -13291,7 +13295,7 @@ inline QualType Sema::CheckBitwiseOperands(ExprResult &LHS, ExprResult &RHS,
13291
13295
if (LHS.get()->getType()->hasIntegerRepresentation() &&
13292
13296
RHS.get()->getType()->hasIntegerRepresentation())
13293
13297
return CheckSizelessVectorOperands(LHS, RHS, Loc, IsCompAssign,
13294
- ACK_BitwiseOp );
13298
+ ArithConvKind::BitwiseOp );
13295
13299
return InvalidOperands(Loc, LHS, RHS);
13296
13300
}
13297
13301
@@ -13304,7 +13308,8 @@ inline QualType Sema::CheckBitwiseOperands(ExprResult &LHS, ExprResult &RHS,
13304
13308
13305
13309
ExprResult LHSResult = LHS, RHSResult = RHS;
13306
13310
QualType compType = UsualArithmeticConversions(
13307
- LHSResult, RHSResult, Loc, IsCompAssign ? ACK_CompAssign : ACK_BitwiseOp);
13311
+ LHSResult, RHSResult, Loc,
13312
+ IsCompAssign ? ArithConvKind::CompAssign : ArithConvKind::BitwiseOp);
13308
13313
if (LHSResult.isInvalid() || RHSResult.isInvalid())
13309
13314
return QualType();
13310
13315
LHS = LHSResult.get();
0 commit comments