summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-05-08 23:34:38 +0000
committerDouglas Gregor <dgregor@apple.com>2010-05-08 23:34:38 +0000
commit6d319c62c512db6639bffeee3979f8b7dfb6bf34 (patch)
treefaa65b8454f5e4454907bb0b0dc948d96b02bf0a /clang/lib
parent15837f8f639cb41e8b8412e3fa9cd3920fbdb849 (diff)
downloadbcm5719-llvm-6d319c62c512db6639bffeee3979f8b7dfb6bf34.tar.gz
bcm5719-llvm-6d319c62c512db6639bffeee3979f8b7dfb6bf34.zip
Fix a silly bootstrap-breaking thinko, where we were trying to convert
non-existent condition expressions to boolean values during template instantiation. llvm-svn: 103364
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/TreeTransform.h48
1 files changed, 28 insertions, 20 deletions
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index ec6e96b706d..77d720b3740 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -3493,12 +3493,15 @@ TreeTransform<Derived>::TransformIfStmt(IfStmt *S) {
return SemaRef.StmtError();
// Convert the condition to a boolean value.
- OwningExprResult CondE = getSema().ActOnBooleanCondition(0, S->getIfLoc(),
- move(Cond));
- if (CondE.isInvalid())
- return getSema().StmtError();
+ if (S->getCond()) {
+ OwningExprResult CondE = getSema().ActOnBooleanCondition(0,
+ S->getIfLoc(),
+ move(Cond));
+ if (CondE.isInvalid())
+ return getSema().StmtError();
- Cond = move(CondE);
+ Cond = move(CondE);
+ }
}
Sema::FullExprArg FullCond(getSema().MakeFullExpr(Cond));
@@ -3584,14 +3587,16 @@ TreeTransform<Derived>::TransformWhileStmt(WhileStmt *S) {
if (Cond.isInvalid())
return SemaRef.StmtError();
-
- // Convert the condition to a boolean value.
- OwningExprResult CondE = getSema().ActOnBooleanCondition(0,
+
+ if (S->getCond()) {
+ // Convert the condition to a boolean value.
+ OwningExprResult CondE = getSema().ActOnBooleanCondition(0,
S->getWhileLoc(),
- move(Cond));
- if (CondE.isInvalid())
- return getSema().StmtError();
- Cond = move(CondE);
+ move(Cond));
+ if (CondE.isInvalid())
+ return getSema().StmtError();
+ Cond = move(CondE);
+ }
}
Sema::FullExprArg FullCond(getSema().MakeFullExpr(Cond));
@@ -3660,14 +3665,17 @@ TreeTransform<Derived>::TransformForStmt(ForStmt *S) {
if (Cond.isInvalid())
return SemaRef.StmtError();
-
- // Convert the condition to a boolean value.
- OwningExprResult CondE = getSema().ActOnBooleanCondition(0, S->getForLoc(),
- move(Cond));
- if (CondE.isInvalid())
- return getSema().StmtError();
-
- Cond = move(CondE);
+
+ if (S->getCond()) {
+ // Convert the condition to a boolean value.
+ OwningExprResult CondE = getSema().ActOnBooleanCondition(0,
+ S->getForLoc(),
+ move(Cond));
+ if (CondE.isInvalid())
+ return getSema().StmtError();
+
+ Cond = move(CondE);
+ }
}
Sema::FullExprArg FullCond(getSema().MakeFullExpr(Cond));
OpenPOWER on IntegriCloud