]> granicus.if.org Git - clang/commitdiff
"Do" loops cannot have condition variables, so don't parse them.
authorDouglas Gregor <dgregor@apple.com>
Tue, 24 Nov 2009 21:34:32 +0000 (21:34 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 24 Nov 2009 21:34:32 +0000 (21:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89801 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseStmt.cpp
test/SemaTemplate/instantiate-function-1.cpp

index 66e61dd949f68c562aff05b81c1f148a80a039a3..294f8729884f562589670a5f456d5991348acca6 100644 (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())
index 2749ec24401bf5038fa5af21bdfddebb68797d85..a6c269febea15bdd0416ab1a732e39015d109991 100644 (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());
   }
 };