diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-09-03 21:38:09 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-09-03 21:38:09 +0000 |
commit | 2b6ca46c6b66096bc5dfc6f82c46cfb1761f4f53 (patch) | |
tree | 7881f432fe5f94b677450a7615703ef1e31e3782 /clang/lib/Sema/Sema.h | |
parent | 59a1cd4a063a65983551a73dd858116fe2a01bbc (diff) | |
download | bcm5719-llvm-2b6ca46c6b66096bc5dfc6f82c46cfb1761f4f53.tar.gz bcm5719-llvm-2b6ca46c6b66096bc5dfc6f82c46cfb1761f4f53.zip |
Improve template instantiation for member access expressions that
involve qualified names, e.g., x->Base::f. We now maintain enough
information in the AST to compare the results of the name lookup of
"Base" in the scope of the postfix-expression (determined at template
definition time) and in the type of the object expression.
llvm-svn: 80953
Diffstat (limited to 'clang/lib/Sema/Sema.h')
-rw-r--r-- | clang/lib/Sema/Sema.h | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index a992936d18f..766d18bde1b 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -1610,13 +1610,15 @@ public: SourceLocation MemberLoc, DeclarationName MemberName, DeclPtrTy ImplDecl, - const CXXScopeSpec *SS = 0) { + const CXXScopeSpec *SS = 0, + NamedDecl *FirstQualifierInScope = 0) { // FIXME: Temporary helper while we migrate existing calls to // BuildMemberReferenceExpr to support explicitly-specified template // arguments. return BuildMemberReferenceExpr(S, move(Base), OpLoc, OpKind, MemberLoc, MemberName, false, SourceLocation(), 0, 0, - SourceLocation(), ImplDecl, SS); + SourceLocation(), ImplDecl, SS, + FirstQualifierInScope); } OwningExprResult BuildMemberReferenceExpr(Scope *S, ExprArg Base, @@ -1630,7 +1632,8 @@ public: unsigned NumExplicitTemplateArgs, SourceLocation RAngleLoc, DeclPtrTy ImplDecl, - const CXXScopeSpec *SS = 0); + const CXXScopeSpec *SS, + NamedDecl *FirstQualifierInScope = 0); virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base, SourceLocation OpLoc, @@ -2047,12 +2050,18 @@ public: virtual CXXScopeTy *ActOnCXXGlobalScopeSpecifier(Scope *S, SourceLocation CCLoc); - /// ActOnCXXNestedNameSpecifier - Called during parsing of a - /// nested-name-specifier. e.g. for "foo::bar::" we parsed "foo::" and now - /// we want to resolve "bar::". 'SS' is empty or the previously parsed - /// nested-name part ("foo::"), 'IdLoc' is the source location of 'bar', - /// 'CCLoc' is the location of '::' and 'II' is the identifier for 'bar'. - /// Returns a CXXScopeTy* object representing the C++ scope. + NamedDecl *FindFirstQualifierInScope(Scope *S, NestedNameSpecifier *NNS); + + + CXXScopeTy *BuildCXXNestedNameSpecifier(Scope *S, + const CXXScopeSpec &SS, + SourceLocation IdLoc, + SourceLocation CCLoc, + IdentifierInfo &II, + QualType ObjectType, + NamedDecl *ScopeLookupResult, + bool EnteringContext); + virtual CXXScopeTy *ActOnCXXNestedNameSpecifier(Scope *S, const CXXScopeSpec &SS, SourceLocation IdLoc, |