"Do" loops cannot have condition variables, so don't parse them.

llvm-svn: 89801
This commit is contained in:
Douglas Gregor 2009-11-24 21:34:32 +00:00
parent 680f861d74
commit 7f800f9d50
2 changed files with 3 additions and 7 deletions

View File

@ -875,10 +875,9 @@ Parser::OwningStmtResult Parser::ParseDoStatement(AttributeList *Attr) {
}
// Parse the parenthesized condition.
OwningExprResult Cond(Actions);
SourceLocation LPLoc, RPLoc;
ParseParenExprOrCondition(Cond, true, &LPLoc, &RPLoc);
SourceLocation LPLoc = ConsumeParen();
OwningExprResult Cond = ParseExpression();
SourceLocation RPLoc = MatchRHSPunctuation(tok::r_paren, LPLoc);
DoScope.Exit();
if (Cond.isInvalid() || Body.isInvalid())

View File

@ -106,9 +106,6 @@ template<typename T> struct Do0 {
void f(T t) {
do {
} while (t); // expected-error{{not contextually}}
do {
} while (T t2 = T());
}
};