diff options
| author | John McCall <rjmccall@apple.com> | 2010-03-30 21:47:33 +0000 | 
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2010-03-30 21:47:33 +0000 | 
| commit | 16df1e59f2bb77de9ccdbc36262679d84f8a7d54 (patch) | |
| tree | ee052fb68e2d926668439e8d67cb88dd5c8e481d /clang/lib/Sema/SemaCXXCast.cpp | |
| parent | cf35648ebe0b23c3a0eb0917f1dd21e5b3693e07 (diff) | |
| download | bcm5719-llvm-16df1e59f2bb77de9ccdbc36262679d84f8a7d54.tar.gz bcm5719-llvm-16df1e59f2bb77de9ccdbc36262679d84f8a7d54.zip | |
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
Diffstat (limited to 'clang/lib/Sema/SemaCXXCast.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaCXXCast.cpp | 9 | 
1 files changed, 6 insertions, 3 deletions
| diff --git a/clang/lib/Sema/SemaCXXCast.cpp b/clang/lib/Sema/SemaCXXCast.cpp index 2b93d38e2ab..11c8e6ddab5 100644 --- a/clang/lib/Sema/SemaCXXCast.cpp +++ b/clang/lib/Sema/SemaCXXCast.cpp @@ -808,8 +808,10 @@ TryStaticMemberPointerUpcast(Sema &Self, Expr *&SrcExpr, QualType SrcType,      return TC_NotApplicable;    bool WasOverloadedFunction = false; +  DeclAccessPair FoundOverload;    if (FunctionDecl *Fn -          = Self.ResolveAddressOfOverloadedFunction(SrcExpr, DestType, false)) { +        = Self.ResolveAddressOfOverloadedFunction(SrcExpr, DestType, false, +                                                  FoundOverload)) {      CXXMethodDecl *M = cast<CXXMethodDecl>(Fn);      SrcType = Self.Context.getMemberPointerType(Fn->getType(),                      Self.Context.getTypeDeclType(M->getParent()).getTypePtr()); @@ -870,13 +872,14 @@ TryStaticMemberPointerUpcast(Sema &Self, Expr *&SrcExpr, QualType SrcType,      // allowing complaints if something goes wrong.      FunctionDecl *Fn = Self.ResolveAddressOfOverloadedFunction(SrcExpr,                                                                  DestType,  -                                                               true); +                                                               true, +                                                               FoundOverload);      if (!Fn) {        msg = 0;        return TC_Failed;      } -    SrcExpr = Self.FixOverloadedFunctionReference(SrcExpr, Fn); +    SrcExpr = Self.FixOverloadedFunctionReference(SrcExpr, FoundOverload, Fn);      if (!SrcExpr) {        msg = 0;        return TC_Failed; | 

