diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-06-16 00:17:44 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-06-16 00:17:44 +0000 |
commit | 2ade35e2cfd554e49d35a52047cea98a82787af9 (patch) | |
tree | b3d261cde2d8f15007d53bd5f103ab6d1b75a595 /lib/Sema/SemaOverload.cpp | |
parent | ff2d05f653948e4bb2877c210f9fa7a2888ceb5c (diff) |
Introduce Type::isIntegralOrEnumerationType(), to cover those places
in C++ that involve both integral and enumeration types. Convert all
of the callers to Type::isIntegralType() that are meant to work with
both integral and enumeration types over to
Type::isIntegralOrEnumerationType(), to prepare to eliminate
enumeration types as integral types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106071 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r-- | lib/Sema/SemaOverload.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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, |