From 90d554ecb30d5282aff54aca2f9b0f3751e83c8c Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Sun, 21 Feb 2010 18:36:56 +0000 Subject: 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. llvm-svn: 96743 --- clang/lib/Sema/Sema.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'clang/lib/Sema/Sema.h') diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index 25ca3d1144c..4ea379328c1 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -2198,7 +2198,8 @@ public: 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 @@ public: SourceLocation IdLoc, SourceLocation CCLoc, IdentifierInfo &II, + bool MayBePseudoDestructor, QualType ObjectType, NamedDecl *ScopeLookupResult, bool EnteringContext, @@ -2217,12 +2219,14 @@ public: 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 @@ public: const CXXScopeSpec &SS, TypeTy *Type, SourceRange TypeRange, - SourceLocation CCLoc); + SourceLocation CCLoc, + bool MayBePseudoDestructor); virtual bool ShouldEnterDeclaratorScope(Scope *S, const CXXScopeSpec &SS); -- cgit v1.2.3