summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-12 06:12:50 +0000
committerChris Lattner <sabre@nondot.org>2010-04-12 06:12:50 +0000
commitdf74264787d6e1b63b117de7c344ac79ad98751a (patch)
tree51b5d28ffcabe35c58cb2b53cc032eeac61138dc /clang/lib/Sema/SemaExpr.cpp
parent7974fb130f88a7437e834a45942270d8950e0dae (diff)
downloadbcm5719-llvm-df74264787d6e1b63b117de7c344ac79ad98751a.tar.gz
bcm5719-llvm-df74264787d6e1b63b117de7c344ac79ad98751a.zip
change Scope::WithinElse to be a normal scope flag, widen the
fields to two 16-bit values instead of using bitfields. llvm-svn: 101020
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 263005908c8..d6f135863d2 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -1105,16 +1105,15 @@ Sema::OwningExprResult Sema::ActOnIdExpression(Scope *S,
// Warn about constructs like:
// if (void *X = foo()) { ... } else { X }.
// In the else block, the pointer is always false.
-
if (Var->isDeclaredInCondition() && Var->getType()->isScalarType()) {
Scope *CheckS = S;
while (CheckS && CheckS->getControlParent()) {
- if (CheckS->isWithinElse() &&
+ if ((CheckS->getFlags() & Scope::ElseScope) &&
CheckS->getControlParent()->isDeclScope(DeclPtrTy::make(Var))) {
ExprError(Diag(NameLoc, diag::warn_value_always_zero)
<< Var->getDeclName()
- << (Var->getType()->isPointerType()? 2 :
- Var->getType()->isBooleanType()? 1 : 0));
+ << (Var->getType()->isPointerType() ? 2 :
+ Var->getType()->isBooleanType() ? 1 : 0));
break;
}
OpenPOWER on IntegriCloud