aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Parse/ParseTentative.cpp
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2010-03-03 17:28:16 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2010-03-03 17:28:16 +0000
commit79ade4e028932fcb9dab15e2fb2305ca15ab0f14 (patch)
treee1a885aadfd80632f5bd70d4bd2d37e715e35a79 /lib/Parse/ParseTentative.cpp
parentecb7e5c8afe929ee38155db94de6b084ec32a645 (diff)
downloadsrc-79ade4e028932fcb9dab15e2fb2305ca15ab0f14.tar.gz
src-79ade4e028932fcb9dab15e2fb2305ca15ab0f14.zip
Update clang to 97654.
Notes
Notes: svn path=/vendor/clang/dist/; revision=204643
Diffstat (limited to 'lib/Parse/ParseTentative.cpp')
-rw-r--r--lib/Parse/ParseTentative.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/Parse/ParseTentative.cpp b/lib/Parse/ParseTentative.cpp
index 6251a2f36754..516a9a620b62 100644
--- a/lib/Parse/ParseTentative.cpp
+++ b/lib/Parse/ParseTentative.cpp
@@ -491,7 +491,8 @@ Parser::TPResult Parser::TryParseDeclarator(bool mayBeAbstract,
while (1) {
if (Tok.is(tok::coloncolon) || Tok.is(tok::identifier))
- TryAnnotateCXXScopeToken(true);
+ if (TryAnnotateCXXScopeToken(true))
+ return TPResult::Error();
if (Tok.is(tok::star) || Tok.is(tok::amp) || Tok.is(tok::caret) ||
(Tok.is(tok::annot_cxxscope) && NextToken().is(tok::star))) {
@@ -681,9 +682,10 @@ Parser::TPResult Parser::isCXXDeclarationSpecifier() {
// Annotate typenames and C++ scope specifiers. If we get one, just
// recurse to handle whatever we get.
if (TryAnnotateTypeOrScopeToken())
- return isCXXDeclarationSpecifier();
- // Otherwise, not a typename.
- return TPResult::False();
+ return TPResult::Error();
+ if (Tok.is(tok::identifier))
+ return TPResult::False();
+ return isCXXDeclarationSpecifier();
case tok::coloncolon: { // ::foo::bar
const Token &Next = NextToken();
@@ -694,9 +696,8 @@ Parser::TPResult Parser::isCXXDeclarationSpecifier() {
// Annotate typenames and C++ scope specifiers. If we get one, just
// recurse to handle whatever we get.
if (TryAnnotateTypeOrScopeToken())
- return isCXXDeclarationSpecifier();
- // Otherwise, not a typename.
- return TPResult::False();
+ return TPResult::Error();
+ return isCXXDeclarationSpecifier();
}
// decl-specifier:
@@ -762,7 +763,9 @@ Parser::TPResult Parser::isCXXDeclarationSpecifier() {
case tok::annot_cxxscope: // foo::bar or ::foo::bar, but already parsed
// We've already annotated a scope; try to annotate a type.
- if (!(TryAnnotateTypeOrScopeToken() && Tok.is(tok::annot_typename)))
+ if (TryAnnotateTypeOrScopeToken())
+ return TPResult::Error();
+ if (!Tok.is(tok::annot_typename))
return TPResult::False();
// If that succeeded, fallthrough into the generic simple-type-id case.