aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseTentative.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-10-05 15:19:49 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-10-05 15:19:49 +0000
commitca35baa788ccba7a213365b9d64d6b2f7bdb9afe (patch)
treec0cf6e61f5d977832439f1de332672d3f94c0cf9 /lib/Parse/ParseTentative.cpp
parenta8a4598b6f2a07339ab8a1248295a07d771a2b2a (diff)
Fix Parser::isCXXConditionDeclaration to properly resolve declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57111 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseTentative.cpp')
-rw-r--r--lib/Parse/ParseTentative.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Parse/ParseTentative.cpp b/lib/Parse/ParseTentative.cpp
index 95512a6269..1209b573d0 100644
--- a/lib/Parse/ParseTentative.cpp
+++ b/lib/Parse/ParseTentative.cpp
@@ -259,11 +259,9 @@ bool Parser::isCXXConditionDeclaration() {
// 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 @@ bool Parser::isCXXConditionDeclaration() {
TPR = TPR_false;
}
+ PA.Revert();
+
assert(TPR == TPR_true || TPR == TPR_false);
return TPR == TPR_true;
}