diff options
author | John McCall <rjmccall@apple.com> | 2010-06-12 01:56:02 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-06-12 01:56:02 +0000 |
commit | 6907fbe758d23e1aec4c0a67e7b633d1d855feb4 (patch) | |
tree | cc0183caac12637d2dd8f322672acb9ffda0add0 /lib/Sema/SemaStmt.cpp | |
parent | 1715bf5ed87c792c63278e739bc492921d512a88 (diff) |
When deciding whether an expression has the boolean nature, don't look through
explicit casts. Fixes PR7359.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105871 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index 875b160d71..0c510fb1dd 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -400,9 +400,7 @@ static bool EqEnumVals(const std::pair<llvm::APSInt, EnumConstantDecl*>& lhs, /// GetTypeBeforeIntegralPromotion - Returns the pre-promotion type of /// potentially integral-promoted expression @p expr. static QualType GetTypeBeforeIntegralPromotion(const Expr* expr) { - const ImplicitCastExpr *ImplicitCast = - dyn_cast_or_null<ImplicitCastExpr>(expr); - if (ImplicitCast != NULL) { + if (const CastExpr *ImplicitCast = dyn_cast<ImplicitCastExpr>(expr)) { const Expr *ExprBeforePromotion = ImplicitCast->getSubExpr(); QualType TypeBeforePromotion = ExprBeforePromotion->getType(); if (TypeBeforePromotion->isIntegralType()) { |