diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-06-16 00:35:25 +0000 | 
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-06-16 00:35:25 +0000 | 
| commit | 6972a62c8feda5ac53125978170f89657d978d4e (patch) | |
| tree | 07355e763a1e1757802d01e5f85e0a4e5edbce87 /clang/lib/Sema/SemaOverload.cpp | |
| parent | b672ab9b532f2cd625209189be9a1fda859ce78f (diff) | |
| download | bcm5719-llvm-6972a62c8feda5ac53125978170f89657d978d4e.tar.gz bcm5719-llvm-6972a62c8feda5ac53125978170f89657d978d4e.zip | |
Give Type::isIntegralType() an ASTContext parameter, so that it
provides C "integer type" semantics in C and C++ "integral type"
semantics in C++. 
Note that I still need to update isIntegerType (and possibly other
predicates) using the same approach I've taken for
isIntegralType(). The two should have the same meaning, but currently
don't (!).
llvm-svn: 106074
Diffstat (limited to 'clang/lib/Sema/SemaOverload.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 7 | 
1 files changed, 3 insertions, 4 deletions
| diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 3de8e730c60..24fdff37572 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -963,7 +963,7 @@ Sema::IsStandardConversion(Expr* From, QualType ToType,      SCS.Second = ICK_Complex_Promotion;      FromType = ToType.getUnqualifiedType();    } else if (FromType->isIntegralOrEnumerationType() && -           (ToType->isIntegralType() && !ToType->isEnumeralType())) { +             ToType->isIntegralType(Context)) {      // Integral conversions (C++ 4.7).      SCS.Second = ICK_Integral_Conversion;      FromType = ToType.getUnqualifiedType(); @@ -981,8 +981,7 @@ Sema::IsStandardConversion(Expr* From, QualType ToType,      SCS.Second = ICK_Floating_Conversion;      FromType = ToType.getUnqualifiedType();    } else if ((FromType->isFloatingType() && -              ToType->isIntegralType() && (!ToType->isBooleanType() && -                                           !ToType->isEnumeralType())) || +              ToType->isIntegralType(Context) && !ToType->isBooleanType()) ||               (FromType->isIntegralOrEnumerationType() &&                ToType->isFloatingType())) {      // Floating-integral conversions (C++ 4.9). @@ -1143,7 +1142,7 @@ bool Sema::IsIntegralPromotion(Expr *From, QualType FromType, QualType ToType) {    if (From)      if (FieldDecl *MemberDecl = From->getBitField()) {        APSInt BitWidth; -      if (FromType->isIntegralType() && !FromType->isEnumeralType() && +      if (FromType->isIntegralType(Context) &&            MemberDecl->getBitWidth()->isIntegerConstantExpr(BitWidth, Context)) {          APSInt ToSize(BitWidth.getBitWidth(), BitWidth.isUnsigned());          ToSize = Context.getTypeSize(ToType); | 

