aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/Parser.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-04 23:23:14 +0000
committerChris Lattner <sabre@nondot.org>2009-01-04 23:23:14 +0000
commita7bc7c880f86bc180684ef032d06df51bcae7a23 (patch)
tree4f12a3f17beda17b06035f9aa4b90c31816b2443 /lib/Parse/Parser.cpp
parent74ba410e4df194f99021e4d2dda494c853444482 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61650 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/Parser.cpp')
-rw-r--r--lib/Parse/Parser.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp
index 381c84e317..29843b1668 100644
--- a/lib/Parse/Parser.cpp
+++ b/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