Fix Parser::isCXXConditionDeclaration to properly resolve declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57111 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseTentative.cpp b/lib/Parse/ParseTentative.cpp
index 95512a6..1209b57 100644
--- a/lib/Parse/ParseTentative.cpp
+++ b/lib/Parse/ParseTentative.cpp
@@ -259,11 +259,9 @@
// declarator
TPR = TryParseDeclarator(false/*mayBeAbstract*/);
- PA.Revert();
-
// In case of an error, let the declaration parsing code handle it.
if (TPR == TPR_error)
- return true;
+ TPR = TPR_true;
if (TPR == TPR_ambiguous) {
// '='
@@ -275,6 +273,8 @@
TPR = TPR_false;
}
+ PA.Revert();
+
assert(TPR == TPR_true || TPR == TPR_false);
return TPR == TPR_true;
}