From d14a86427f9cd8e5bc1a114b703f21cf21eefa9c Mon Sep 17 00:00:00 2001 From: John McCall Date: Sat, 21 Nov 2009 08:51:07 +0000 Subject: "Incremental" progress on using expressions, by which I mean totally ripping into pretty much everything about overload resolution in order to wean BuildDeclarationNameExpr off LookupResult::getAsSingleDecl(). Replace UnresolvedFunctionNameExpr with UnresolvedLookupExpr, which generalizes the idea of a non-member lookup that we haven't totally resolved yet, whether by overloading, argument-dependent lookup, or (eventually) the presence of a function template in the lookup results. Incidentally fixes a problem with argument-dependent lookup where we were still performing ADL even when the lookup results contained something from a block scope. Incidentally improves a diagnostic when using an ObjC ivar from a class method. This just fell out from rewriting BuildDeclarationNameExpr's interaction with lookup, and I'm too apathetic to break it out. The only remaining uses of OverloadedFunctionDecl that I know of are in TemplateName and MemberExpr. llvm-svn: 89544 --- clang/lib/Sema/Sema.h | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'clang/lib/Sema/Sema.h') diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index e0c3f135766..e26df119fa5 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -959,7 +959,7 @@ public: bool Complain); Expr *FixOverloadedFunctionReference(Expr *E, FunctionDecl *Fn); - void AddOverloadedCallCandidates(NamedDecl *Callee, + void AddOverloadedCallCandidates(llvm::SmallVectorImpl& Callees, DeclarationName &UnqualifiedName, bool &ArgumentDependentLookup, bool HasExplicitTemplateArgs, @@ -969,7 +969,8 @@ public: OverloadCandidateSet &CandidateSet, bool PartialOverloading = false); - FunctionDecl *ResolveOverloadedCallFn(Expr *Fn, NamedDecl *Callee, + FunctionDecl *ResolveOverloadedCallFn(Expr *Fn, + llvm::SmallVectorImpl &Fns, DeclarationName UnqualifiedName, bool HasExplicitTemplateArgs, const TemplateArgumentLoc *ExplicitTemplateArgs, @@ -1415,10 +1416,18 @@ public: bool HasTrailingLParen, const CXXScopeSpec *SS, bool isAddressOfOperand = false); - OwningExprResult BuildDeclarationNameExpr(SourceLocation Loc, NamedDecl *D, - bool HasTrailingLParen, - const CXXScopeSpec *SS, + OwningExprResult BuildDeclarationNameExpr(const CXXScopeSpec *SS, + LookupResult &R, bool ADL, bool isAddressOfOperand); + OwningExprResult BuildDeclarationNameExpr(const CXXScopeSpec *SS, + SourceLocation Loc, + DeclarationName Name, + bool NeedsADL, + NamedDecl * const *Decls, + unsigned NumDecls); + OwningExprResult BuildDeclarationNameExpr(const CXXScopeSpec *SS, + SourceLocation Loc, + NamedDecl *D); virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc, tok::TokenKind Kind); @@ -1517,7 +1526,7 @@ public: SourceLocation RParenLoc); void DeconstructCallFunction(Expr *FnExpr, - NamedDecl *&Function, + llvm::SmallVectorImpl& Fns, DeclarationName &Name, NestedNameSpecifier *&Qualifier, SourceRange &QualifierRange, -- cgit v1.2.3