[cfe-commits] r89801 - in /cfe/trunk: lib/Parse/ParseStmt.cpp test/SemaTemplate/instantiate-function-1.cpp

Douglas Gregor dgregor at apple.com
Tue Nov 24 13:34:33 PST 2009


Author: dgregor
Date: Tue Nov 24 15:34:32 2009
New Revision: 89801

URL: http://llvm.org/viewvc/llvm-project?rev=89801&view=rev
Log:
"Do" loops cannot have condition variables, so don't parse them.

Modified:
    cfe/trunk/lib/Parse/ParseStmt.cpp
    cfe/trunk/test/SemaTemplate/instantiate-function-1.cpp

Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=89801&r1=89800&r2=89801&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Tue Nov 24 15:34:32 2009
@@ -875,10 +875,9 @@
   }
 
   // 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())

Modified: cfe/trunk/test/SemaTemplate/instantiate-function-1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-function-1.cpp?rev=89801&r1=89800&r2=89801&view=diff

==============================================================================
--- cfe/trunk/test/SemaTemplate/instantiate-function-1.cpp (original)
+++ cfe/trunk/test/SemaTemplate/instantiate-function-1.cpp Tue Nov 24 15:34:32 2009
@@ -106,9 +106,6 @@
   void f(T t) {
     do {
     } while (t); // expected-error{{not contextually}}
-    
-    do {
-    } while (T t2 = T());
   }
 };
 





More information about the cfe-commits mailing list