aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Parse/ParseStmt.cpp7
-rw-r--r--test/SemaTemplate/instantiate-function-1.cpp3
2 files changed, 3 insertions, 7 deletions
diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp
index 66e61dd949..294f872988 100644
--- a/lib/Parse/ParseStmt.cpp
+++ b/lib/Parse/ParseStmt.cpp
@@ -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())
diff --git a/test/SemaTemplate/instantiate-function-1.cpp b/test/SemaTemplate/instantiate-function-1.cpp
index 2749ec2440..a6c269febe 100644
--- a/test/SemaTemplate/instantiate-function-1.cpp
+++ b/test/SemaTemplate/instantiate-function-1.cpp
@@ -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());
}
};