diff options
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/SemaCXXCast.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 6 | ||||
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 3 | ||||
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/SemaOverload.cpp | 6 | ||||
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 4 | ||||
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 6 |
8 files changed, 16 insertions, 15 deletions
diff --git a/lib/Sema/SemaCXXCast.cpp b/lib/Sema/SemaCXXCast.cpp index 16f0af14d2..98270866a2 100644 --- a/lib/Sema/SemaCXXCast.cpp +++ b/lib/Sema/SemaCXXCast.cpp @@ -1163,7 +1163,7 @@ static TryCastResult TryReinterpretCast(Sema &Self, Expr *SrcExpr, return TC_Success; } - if (SrcType->isIntegralType() || SrcType->isEnumeralType()) { + if (SrcType->isIntegralOrEnumerationType()) { assert(destIsPtr && "One type must be a pointer"); // C++ 5.2.10p5: A value of integral or enumeration type can be explicitly // converted to a pointer. diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index e3d20bd5e4..39fbc6a684 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -3949,7 +3949,7 @@ void Sema::AddInitializerToDecl(DeclPtrTy dcl, ExprArg init, bool DirectInit) { QualType T = VDecl->getType(); if (!T->isDependentType() && (!Context.getCanonicalType(T).isConstQualified() || - !T->isIntegralType())) { + !T->isIntegralOrEnumerationType())) { Diag(VDecl->getLocation(), diag::err_member_initialization) << VDecl->getDeclName() << Init->getSourceRange(); VDecl->setInvalidDecl(); @@ -3960,7 +3960,7 @@ void Sema::AddInitializerToDecl(DeclPtrTy dcl, ExprArg init, bool DirectInit) { // can specify a constant-initializer which shall be an // integral constant expression (5.19). if (!Init->isTypeDependent() && - !Init->getType()->isIntegralType()) { + !Init->getType()->isIntegralOrEnumerationType()) { // We have a non-dependent, non-integral or enumeration type. Diag(Init->getSourceRange().getBegin(), diag::err_in_class_initializer_non_integral_type) @@ -5573,7 +5573,7 @@ bool Sema::VerifyBitField(SourceLocation FieldLoc, IdentifierInfo *FieldName, // C99 6.7.2.1p4 - verify the field type. // C++ 9.6p3: A bit-field shall have integral or enumeration type. - if (!FieldTy->isDependentType() && !FieldTy->isIntegralType()) { + if (!FieldTy->isDependentType() && !FieldTy->isIntegralOrEnumerationType()) { // Handle incomplete types with specific error. if (RequireCompleteType(FieldLoc, FieldTy, diag::err_field_incomplete)) return true; diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index c6dcc3b97b..89848afe3e 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -1525,7 +1525,7 @@ static void HandleModeAttr(Decl *D, const AttributeList &Attr, Sema &S) { if (!OldTy->getAs<BuiltinType>() && !OldTy->isComplexType()) S.Diag(Attr.getLoc(), diag::err_mode_not_primitive); else if (IntegerMode) { - if (!OldTy->isIntegralType()) + if (!OldTy->isIntegralOrEnumerationType()) S.Diag(Attr.getLoc(), diag::err_mode_wrong_type); } else if (ComplexMode) { if (!OldTy->isComplexType()) diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index bb5fa71e52..347b597f28 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -3913,7 +3913,8 @@ bool Sema::CheckCastTypes(SourceRange TyR, QualType castType, Expr *&castExpr, if (!castType->isArithmeticType()) { QualType castExprType = castExpr->getType(); - if (!castExprType->isIntegralType() && castExprType->isArithmeticType()) + if (!castExprType->isIntegralType() && + castExprType->isArithmeticType()) return Diag(castExpr->getLocStart(), diag::err_cast_pointer_from_non_pointer_int) << castExprType << castExpr->getSourceRange(); diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 4c93fba384..e478d9a28f 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -720,7 +720,7 @@ Sema::BuildCXXNew(SourceLocation StartLoc, bool UseGlobal, Expr *ArraySize = (Expr *)ArraySizeE.get(); if (ArraySize && !ArraySize->isTypeDependent()) { QualType SizeType = ArraySize->getType(); - if (!SizeType->isIntegralType() && !SizeType->isEnumeralType()) + if (!SizeType->isIntegralOrEnumerationType()) return ExprError(Diag(ArraySize->getSourceRange().getBegin(), diag::err_array_size_not_integral) << SizeType << ArraySize->getSourceRange()); diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index 89eb90bc13..3de8e730c6 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -962,7 +962,7 @@ Sema::IsStandardConversion(Expr* From, QualType ToType, // Complex promotion (Clang extension) SCS.Second = ICK_Complex_Promotion; FromType = ToType.getUnqualifiedType(); - } else if ((FromType->isIntegralType() || FromType->isEnumeralType()) && + } else if (FromType->isIntegralOrEnumerationType() && (ToType->isIntegralType() && !ToType->isEnumeralType())) { // Integral conversions (C++ 4.7). SCS.Second = ICK_Integral_Conversion; @@ -983,7 +983,7 @@ Sema::IsStandardConversion(Expr* From, QualType ToType, } else if ((FromType->isFloatingType() && ToType->isIntegralType() && (!ToType->isBooleanType() && !ToType->isEnumeralType())) || - ((FromType->isIntegralType() || FromType->isEnumeralType()) && + (FromType->isIntegralOrEnumerationType() && ToType->isFloatingType())) { // Floating-integral conversions (C++ 4.9). SCS.Second = ICK_Floating_Integral; @@ -1273,7 +1273,7 @@ static bool isNullPointerConstantForConversion(Expr *Expr, // Handle value-dependent integral null pointer constants correctly. // http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#903 if (Expr->isValueDependent() && !Expr->isTypeDependent() && - Expr->getType()->isIntegralType()) + Expr->getType()->isIntegerType() && !Expr->getType()->isEnumeralType()) return !InOverloadResolution; return Expr->isNullPointerConstant(Context, diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index 0c510fb1dd..cd71239164 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -403,7 +403,7 @@ static QualType GetTypeBeforeIntegralPromotion(const Expr* expr) { if (const CastExpr *ImplicitCast = dyn_cast<ImplicitCastExpr>(expr)) { const Expr *ExprBeforePromotion = ImplicitCast->getSubExpr(); QualType TypeBeforePromotion = ExprBeforePromotion->getType(); - if (TypeBeforePromotion->isIntegralType()) { + if (TypeBeforePromotion->isIntegralOrEnumerationType()) { return TypeBeforePromotion; } } @@ -445,7 +445,7 @@ static bool CheckCXXSwitchCondition(Sema &S, SourceLocation SwitchLoc, if (CXXConversionDecl *Conversion = dyn_cast<CXXConversionDecl>((*I)->getUnderlyingDecl())) if (Conversion->getConversionType().getNonReferenceType() - ->isIntegralType()) { + ->isIntegralOrEnumerationType()) { if (Conversion->isExplicit()) ExplicitConversions.addDecl(I.getDecl(), I.getAccess()); else diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 234665c4aa..a2d4de5b1f 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -549,7 +549,7 @@ Sema::CheckNonTypeTemplateParameterType(QualType T, SourceLocation Loc) { // (optionally cv-qualified) types: // // -- integral or enumeration type, - if (T->isIntegralType() || T->isEnumeralType() || + if (T->isIntegralOrEnumerationType() || // -- pointer to object or pointer to function, (T->isPointerType() && (T->getAs<PointerType>()->getPointeeType()->isObjectType() || @@ -2777,7 +2777,7 @@ bool Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, // conversions (4.7) are applied. QualType ParamType = InstantiatedParamType; QualType ArgType = Arg->getType(); - if (ParamType->isIntegralType() || ParamType->isEnumeralType()) { + if (ParamType->isIntegralOrEnumerationType()) { // C++ [temp.arg.nontype]p1: // A template-argument for a non-type, non-template // template-parameter shall be one of: @@ -2787,7 +2787,7 @@ bool Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, // -- the name of a non-type template-parameter; or SourceLocation NonConstantLoc; llvm::APSInt Value; - if (!ArgType->isIntegralType() && !ArgType->isEnumeralType()) { + if (!ArgType->isIntegralOrEnumerationType()) { Diag(Arg->getSourceRange().getBegin(), diag::err_template_arg_not_integral_or_enumeral) << ArgType << Arg->getSourceRange(); |