зеркало из https://github.com/microsoft/clang-1.git
Fix a silly bootstrap-breaking thinko, where we were trying to convert
non-existent condition expressions to boolean values during template instantiation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103364 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
836fc14e6c
Коммит
afa0fefb57
|
@ -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));
|
||||
|
|
Загрузка…
Ссылка в новой задаче