forked from OSchip/llvm-project
parent
da0300870f
commit
6b87b9d84e
|
@ -46,11 +46,6 @@ bool Parser::MaybeParseCXXScopeSpecifier(CXXScopeSpec &SS,
|
|||
return true;
|
||||
}
|
||||
|
||||
if (GlobalQualifier == 0 &&
|
||||
Tok.isNot(tok::coloncolon) &&
|
||||
(Tok.isNot(tok::identifier) || NextToken().isNot(tok::coloncolon)))
|
||||
return false;
|
||||
|
||||
if (GlobalQualifier) {
|
||||
// Pre-parsed '::'.
|
||||
SS.setBeginLoc(GlobalQualifier->getLocation());
|
||||
|
@ -60,11 +55,8 @@ bool Parser::MaybeParseCXXScopeSpecifier(CXXScopeSpec &SS,
|
|||
|
||||
assert(Tok.isNot(tok::kw_new) && Tok.isNot(tok::kw_delete) &&
|
||||
"Never called with preparsed :: qualifier and with new/delete");
|
||||
} else {
|
||||
SS.setBeginLoc(Tok.getLocation());
|
||||
|
||||
} else if (Tok.is(tok::coloncolon)) {
|
||||
// '::' - Global scope qualifier.
|
||||
if (Tok.is(tok::coloncolon)) {
|
||||
SourceLocation CCLoc = ConsumeToken();
|
||||
|
||||
// ::new and ::delete aren't nested-name-specifiers, and
|
||||
|
@ -73,14 +65,17 @@ bool Parser::MaybeParseCXXScopeSpecifier(CXXScopeSpec &SS,
|
|||
if (Tok.is(tok::kw_new) || Tok.is(tok::kw_delete)) {
|
||||
Diag(Tok, diag::err_invalid_qualified_new_delete)
|
||||
<< Tok.is(tok::kw_delete);
|
||||
SS.setBeginLoc(SourceLocation());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Global scope.
|
||||
SS.setBeginLoc(CCLoc);
|
||||
SS.setScopeRep(Actions.ActOnCXXGlobalScopeSpecifier(CurScope, CCLoc));
|
||||
SS.setEndLoc(CCLoc);
|
||||
}
|
||||
} else if (Tok.is(tok::identifier) && NextToken().is(tok::coloncolon)) {
|
||||
SS.setBeginLoc(Tok.getLocation());
|
||||
} else {
|
||||
// Not a CXXScopeSpecifier.
|
||||
return false;
|
||||
}
|
||||
|
||||
// nested-name-specifier:
|
||||
|
|
Loading…
Reference in New Issue