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 | 91d3f338e446e654392184e68f940c77b5c98f39 (patch) | |
tree | ea6d88f7d40d23adbcdc4edacf12108495d949e8 /lib/Sema/SemaAccess.cpp | |
parent | 1596e5b368ddbdc4b9c3ecab75115b179b6e5391 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191726 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaAccess.cpp')
-rw-r--r-- | lib/Sema/SemaAccess.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Sema/SemaAccess.cpp b/lib/Sema/SemaAccess.cpp index 6dbfad4e18..974f3b42db 100644 --- a/lib/Sema/SemaAccess.cpp +++ b/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); } |