aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaStmt.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-06-16 00:17:44 +0000
committerDouglas Gregor <dgregor@apple.com>2010-06-16 00:17:44 +0000
commit2ade35e2cfd554e49d35a52047cea98a82787af9 (patch)
treeb3d261cde2d8f15007d53bd5f103ab6d1b75a595 /lib/Sema/SemaStmt.cpp
parentff2d05f653948e4bb2877c210f9fa7a2888ceb5c (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/SemaStmt.cpp')
-rw-r--r--lib/Sema/SemaStmt.cpp4
1 files changed, 2 insertions, 2 deletions
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