diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-02-25 04:46:04 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-02-25 04:46:04 +0000 |
commit | edc90500b1d2587bf0b698fada14537d6741fddf (patch) | |
tree | eec1022df7b9f1f89646a4a8da186aa978e42c77 /lib/Parse/ParseExprCXX.cpp | |
parent | b954e98893505d401acddac42650a81b83d8dc39 (diff) |
Restore the invariant that a nested-name-specifier can only contain
class types, dependent types, and namespaces. I had previously
weakened this invariant while working on parsing pseudo-destructor
expressions, but recent work in that area has made these changes
unnecessary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97112 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExprCXX.cpp')
-rw-r--r-- | lib/Parse/ParseExprCXX.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp index 4d46b92a03..7998b26f9b 100644 --- a/lib/Parse/ParseExprCXX.cpp +++ b/lib/Parse/ParseExprCXX.cpp @@ -212,8 +212,7 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS, Actions.ActOnCXXNestedNameSpecifier(CurScope, SS, TypeToken.getAnnotationValue(), TypeToken.getAnnotationRange(), - CCLoc, - false)); + CCLoc)); else SS.setScopeRep(0); SS.setEndLoc(CCLoc); @@ -240,15 +239,7 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS, // If we get foo:bar, this is almost certainly a typo for foo::bar. Recover // and emit a fixit hint for it. if (Next.is(tok::colon) && !ColonIsSacred) { - if (CheckForDestructor && GetLookAheadToken(2).is(tok::tilde) && - !Actions.isNonTypeNestedNameSpecifier(CurScope, SS, Tok.getLocation(), - II, ObjectType)) { - *MayBePseudoDestructor = true; - return HasScopeSpecifier; - } - - if (Actions.IsInvalidUnlessNestedName(CurScope, SS, II, - false, ObjectType, + if (Actions.IsInvalidUnlessNestedName(CurScope, SS, II, ObjectType, EnteringContext) && // If the token after the colon isn't an identifier, it's still an // error, but they probably meant something else strange so don't @@ -287,8 +278,7 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS, SS.setScopeRep( Actions.ActOnCXXNestedNameSpecifier(CurScope, SS, IdLoc, CCLoc, II, - false, ObjectType, - EnteringContext)); + ObjectType, EnteringContext)); SS.setEndLoc(CCLoc); continue; } |