diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2013-10-01 02:44:48 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2013-10-01 02:44:48 +0000 |
commit | 3be1a1c0b5f3b11457996ce63e7eb5774dadfcde (patch) | |
tree | 7a6cf2869fb8e79b83316366bd3b1316db986f93 /clang/lib/Sema/SemaAccess.cpp | |
parent | e4aaac506c6d3496ae4120b68f03886402c0428c (diff) | |
download | bcm5719-llvm-3be1a1c0b5f3b11457996ce63e7eb5774dadfcde.tar.gz bcm5719-llvm-3be1a1c0b5f3b11457996ce63e7eb5774dadfcde.zip |
Fix typo correction usage of SemaAccess.cpp.
When we check access for lookup results, make sure we propagate the
result's access to the access control APIs; this can be different from
the natural access of the declaration depending on the path used by the lookup.
PR17394.
llvm-svn: 191726
Diffstat (limited to 'clang/lib/Sema/SemaAccess.cpp')
-rw-r--r-- | clang/lib/Sema/SemaAccess.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaAccess.cpp b/clang/lib/Sema/SemaAccess.cpp index 6dbfad4e18d..974f3b42db1 100644 --- a/clang/lib/Sema/SemaAccess.cpp +++ b/clang/lib/Sema/SemaAccess.cpp @@ -1390,8 +1390,6 @@ static AccessResult IsAccessible(Sema &S, CXXBasePath *Path = FindBestPath(S, EC, Entity, FinalAccess, Paths); if (!Path) return AR_dependent; - if (Path->Access == AS_none) // This can happen during typo correction. - return AR_inaccessible; assert(Path->Access <= UnprivilegedAccess && "access along best path worse than direct?"); @@ -1716,14 +1714,14 @@ Sema::AccessResult Sema::CheckAllocationAccess(SourceLocation OpLoc, /// \brief Checks access to a member. Sema::AccessResult Sema::CheckMemberAccess(SourceLocation UseLoc, CXXRecordDecl *NamingClass, - NamedDecl *D) { + DeclAccessPair Found) { if (!getLangOpts().AccessControl || !NamingClass || - D->getAccess() == AS_public) + Found.getAccess() == AS_public) return AR_accessible; AccessTarget Entity(Context, AccessTarget::Member, NamingClass, - DeclAccessPair::make(D, D->getAccess()), QualType()); + Found, QualType()); return CheckAccess(*this, UseLoc, Entity); } |