aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/search.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2009-01-16 13:35:28 -0500
committerJason Merrill <jason@gcc.gnu.org>2009-01-16 13:35:28 -0500
commit1ceb2263cf6a4e682709c2a8eb38b348943e99dd (patch)
treed4f7041a5bb0761159f40d5daad1c4d65dd1a875 /gcc/cp/search.c
parentbcab4e19dad2f3961908459964df00c086a19c13 (diff)
downloadgcc-1ceb2263cf6a4e682709c2a8eb38b348943e99dd.zip
gcc-1ceb2263cf6a4e682709c2a8eb38b348943e99dd.tar.gz
gcc-1ceb2263cf6a4e682709c2a8eb38b348943e99dd.tar.bz2
re PR c++/38579 (Template: Wrong inherited copy-ctor visibility)
PR c++/38579 * search.c (protected_accessible_p): N doesn't vary. From-SVN: r143439
Diffstat (limited to 'gcc/cp/search.c')
-rw-r--r--gcc/cp/search.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 7fc040b..ecc7926 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -721,20 +721,13 @@ protected_accessible_p (tree decl, tree derived, tree binfo)
m as a member of N is protected, and the reference occurs in a
member or friend of class N, or in a member or friend of a
- class P derived from N, where m as a member of P is private or
- protected.
-
- Here DERIVED is a possible P and DECL is m. accessible_p will
- iterate over various values of N, but the access to m in DERIVED
- does not change.
+ class P derived from N, where m as a member of P is public, private
+ or protected.
- Note that I believe that the passage above is wrong, and should read
- "...is private or protected or public"; otherwise you get bizarre results
- whereby a public using-decl can prevent you from accessing a protected
- member of a base. (jason 2000/02/28) */
+ Here DERIVED is a possible P, DECL is m and BINFO_TYPE (binfo) is N. */
- /* If DERIVED isn't derived from m's class, then it can't be a P. */
- if (!DERIVED_FROM_P (context_for_name_lookup (decl), derived))
+ /* If DERIVED isn't derived from N, then it can't be a P. */
+ if (!DERIVED_FROM_P (BINFO_TYPE (binfo), derived))
return 0;
access = access_in_type (derived, decl);