Implement support for parsing pseudo-destructor expression with a nested-name-specifier, e.g.,
typedef int Int;
int *p;
p->Int::~Int();
This weakens the invariant that the only types in nested-name-specifiers are tag types (restricted to class types in C++98/03). However, we weaken this invariant as little as possible, accepting arbitrary types in nested-name-specifiers only when we're in a member access expression that looks like a pseudo-destructor expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96743 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index 25ca3d1..4ea3793 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -2198,7 +2198,8 @@
virtual CXXScopeTy *ActOnCXXGlobalScopeSpecifier(Scope *S,
SourceLocation CCLoc);
- bool isAcceptableNestedNameSpecifier(NamedDecl *SD);
+ bool isAcceptableNestedNameSpecifier(NamedDecl *SD,
+ bool MayBePseudoDestructor = false);
NamedDecl *FindFirstQualifierInScope(Scope *S, NestedNameSpecifier *NNS);
@@ -2207,6 +2208,7 @@
SourceLocation IdLoc,
SourceLocation CCLoc,
IdentifierInfo &II,
+ bool MayBePseudoDestructor,
QualType ObjectType,
NamedDecl *ScopeLookupResult,
bool EnteringContext,
@@ -2217,12 +2219,14 @@
SourceLocation IdLoc,
SourceLocation CCLoc,
IdentifierInfo &II,
+ bool MayBePseudoDestructor,
TypeTy *ObjectType,
bool EnteringContext);
virtual bool IsInvalidUnlessNestedName(Scope *S,
const CXXScopeSpec &SS,
IdentifierInfo &II,
+ bool MayBePseudoDestructor,
TypeTy *ObjectType,
bool EnteringContext);
@@ -2238,7 +2242,8 @@
const CXXScopeSpec &SS,
TypeTy *Type,
SourceRange TypeRange,
- SourceLocation CCLoc);
+ SourceLocation CCLoc,
+ bool MayBePseudoDestructor);
virtual bool ShouldEnterDeclaratorScope(Scope *S, const CXXScopeSpec &SS);