From 16df1e59f2bb77de9ccdbc36262679d84f8a7d54 Mon Sep 17 00:00:00 2001 From: John McCall Date: Tue, 30 Mar 2010 21:47:33 +0000 Subject: Propagate the "found declaration" (i.e. the using declaration instead of the underlying/instantiated decl) through a lot of API, including "intermediate" MemberExprs required for (e.g.) template instantiation. This is necessary because of the access semantics of member accesses to using declarations: only the base class *containing the using decl* need be accessible from the naming class. This allows us to complete an access-controlled selfhost, if there are no recent regressions. llvm-svn: 99936 --- clang/lib/Sema/Sema.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'clang/lib/Sema/Sema.h') diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index 859e4975764..d3e55f381e1 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -1119,6 +1119,7 @@ public: CXXRecordDecl *ActingContext); bool PerformObjectArgumentInitialization(Expr *&From, NestedNameSpecifier *Qualifier, + NamedDecl *FoundDecl, CXXMethodDecl *Method); ImplicitConversionSequence TryContextuallyConvertToBool(Expr *From); @@ -1126,6 +1127,7 @@ public: bool PerformObjectMemberConversion(Expr *&From, NestedNameSpecifier *Qualifier, + NamedDecl *FoundDecl, NamedDecl *Member); // Members have to be NamespaceDecl* or TranslationUnitDecl*. @@ -1246,11 +1248,15 @@ public: const PartialDiagnostic &PDiag); FunctionDecl *ResolveAddressOfOverloadedFunction(Expr *From, QualType ToType, - bool Complain); + bool Complain, + DeclAccessPair &Found); FunctionDecl *ResolveSingleFunctionTemplateSpecialization(Expr *From); - Expr *FixOverloadedFunctionReference(Expr *E, FunctionDecl *Fn); + Expr *FixOverloadedFunctionReference(Expr *E, + NamedDecl *FoundDecl, + FunctionDecl *Fn); OwningExprResult FixOverloadedFunctionReference(OwningExprResult, + NamedDecl *FoundDecl, FunctionDecl *Fn); void AddOverloadedCallCandidates(UnresolvedLookupExpr *ULE, @@ -2395,7 +2401,9 @@ public: Expr *BuildObjCEncodeExpression(SourceLocation AtLoc, QualType EncodedType, SourceLocation RParenLoc); - CXXMemberCallExpr *BuildCXXMemberCallExpr(Expr *Exp, CXXMethodDecl *Method); + CXXMemberCallExpr *BuildCXXMemberCallExpr(Expr *Exp, + NamedDecl *FoundDecl, + CXXMethodDecl *Method); virtual ExprResult ParseObjCEncodeExpression(SourceLocation AtLoc, SourceLocation EncodeLoc, @@ -2640,6 +2648,8 @@ public: Expr *ObjectExpr, Expr *ArgExpr, DeclAccessPair FoundDecl); + AccessResult CheckAddressOfMemberAccess(Expr *OvlExpr, + DeclAccessPair FoundDecl); AccessResult CheckBaseClassAccess(SourceLocation AccessLoc, QualType Base, QualType Derived, const CXXBasePath &Path, -- cgit v1.2.3