aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Parse/ParseTentative.cpp
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2010-01-01 10:34:51 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2010-01-01 10:34:51 +0000
commitabe15e553e58165e7692c0d0842865c488ed7b45 (patch)
tree1e68501209c9133fbda8d45171e59f8d6f12dd55 /lib/Parse/ParseTentative.cpp
parent34d02d0b37f16015f317a935c48ce8b7b64ae77b (diff)
downloadsrc-abe15e553e58165e7692c0d0842865c488ed7b45.tar.gz
src-abe15e553e58165e7692c0d0842865c488ed7b45.zip
Updaet clang to 92395.
Notes
Notes: svn path=/vendor/clang/dist/; revision=201361
Diffstat (limited to 'lib/Parse/ParseTentative.cpp')
-rw-r--r--lib/Parse/ParseTentative.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/Parse/ParseTentative.cpp b/lib/Parse/ParseTentative.cpp
index dabd065a979a..51c56706bb59 100644
--- a/lib/Parse/ParseTentative.cpp
+++ b/lib/Parse/ParseTentative.cpp
@@ -680,10 +680,11 @@ Parser::TPResult Parser::isCXXDeclarationSpecifier() {
// Otherwise, not a typename.
return TPResult::False();
- case tok::coloncolon: // ::foo::bar
- if (NextToken().is(tok::kw_new) || // ::new
- NextToken().is(tok::kw_delete)) // ::delete
- return TPResult::False();
+ case tok::coloncolon: { // ::foo::bar
+ const Token &Next = NextToken();
+ if (Next.is(tok::kw_new) || // ::new
+ Next.is(tok::kw_delete)) // ::delete
+ return TPResult::False();
// Annotate typenames and C++ scope specifiers. If we get one, just
// recurse to handle whatever we get.
@@ -691,7 +692,8 @@ Parser::TPResult Parser::isCXXDeclarationSpecifier() {
return isCXXDeclarationSpecifier();
// Otherwise, not a typename.
return TPResult::False();
-
+ }
+
// decl-specifier:
// storage-class-specifier
// type-specifier
@@ -699,7 +701,6 @@ Parser::TPResult Parser::isCXXDeclarationSpecifier() {
// 'friend'
// 'typedef'
// 'constexpr'
-
case tok::kw_friend:
case tok::kw_typedef:
case tok::kw_constexpr:
@@ -750,6 +751,12 @@ Parser::TPResult Parser::isCXXDeclarationSpecifier() {
case tok::kw___forceinline:
return TPResult::True();
+ 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)))
+ return TPResult::False();
+ // If that succeeded, fallthrough into the generic simple-type-id case.
+
// The ambiguity resides in a simple-type-specifier/typename-specifier
// followed by a '('. The '(' could either be the start of:
//