[cfe-commits] r103364 - /cfe/trunk/lib/Sema/TreeTransform.h
Douglas Gregor
dgregor at apple.com
Sat May 8 16:34:38 PDT 2010
Author: dgregor
Date: Sat May 8 18:34:38 2010
New Revision: 103364
URL: http://llvm.org/viewvc/llvm-project?rev=103364&view=rev
Log:
Fix a silly bootstrap-breaking thinko, where we were trying to convert
non-existent condition expressions to boolean values during template
instantiation.
Modified:
cfe/trunk/lib/Sema/TreeTransform.h
Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=103364&r1=103363&r2=103364&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Sat May 8 18:34:38 2010
@@ -3493,12 +3493,15 @@
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 @@
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 @@
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));
More information about the cfe-commits
mailing list