From 9a8968b50d8eb0d1c74fed0ba90f5e8fc174d3de Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 4 Jan 2009 23:23:14 +0000 Subject: my previous patch caused sema to drop the global qualifier, make sure to pass it down. This makes the code a bit gross, I will clean it up in subsequent commits. llvm-svn: 61650 --- clang/lib/Parse/Parser.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'clang/lib/Parse/Parser.cpp') diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp index 381c84e3178..29843b16689 100644 --- a/clang/lib/Parse/Parser.cpp +++ b/clang/lib/Parse/Parser.cpp @@ -741,14 +741,16 @@ Parser::OwningExprResult Parser::ParseSimpleAsm() { /// will not be called twice, once to check whether we have a declaration /// specifier, and another one to get the actual type inside /// ParseDeclarationSpecifiers). -void Parser::TryAnnotateTypeOrScopeToken() { +/// +/// This returns true if the token was annotated. +bool Parser::TryAnnotateTypeOrScopeToken(const Token *GlobalQualifier) { // FIXME: what about template-ids? if (Tok.is(tok::annot_qualtypename) || Tok.is(tok::annot_cxxscope)) - return; + return false; CXXScopeSpec SS; if (getLang().CPlusPlus) - MaybeParseCXXScopeSpecifier(SS); + MaybeParseCXXScopeSpecifier(SS, GlobalQualifier); if (Tok.is(tok::identifier)) { DeclTy *Template = 0; @@ -772,7 +774,7 @@ void Parser::TryAnnotateTypeOrScopeToken() { // In case the tokens were cached, have Preprocessor replace // them with the annotation token. PP.AnnotateCachedTokens(Tok); - return; + return true; } } @@ -785,7 +787,7 @@ void Parser::TryAnnotateTypeOrScopeToken() { // names a type. if (SS.isEmpty()) - return; + return false; // A C++ scope specifier that isn't followed by a typename. // Push the current token back into the token stream (or revert it if it is @@ -801,6 +803,7 @@ void Parser::TryAnnotateTypeOrScopeToken() { // In case the tokens were cached, have Preprocessor replace them with the // annotation token. PP.AnnotateCachedTokens(Tok); + return true; } /// TryAnnotateScopeToken - Like TryAnnotateTypeOrScopeToken but only -- cgit v1.2.3