re PR c++/66957 (incorrect "is protected within this context" error)
authorJason Merrill <jason@redhat.com>
Thu, 20 Aug 2015 01:45:49 +0000 (21:45 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 20 Aug 2015 01:45:49 +0000 (21:45 -0400)
commit7ac2c0bd17900b3c0e078479b46de64563a16c9f
treeb65582f3511b73960f319ef3ff55d38d73013c57
parent18c4fa8ef0c5e3d705be8f50860b3e58be672256
re PR c++/66957 (incorrect "is protected within this context" error)

PR c++/66957
* search.c (protected_accessible_p): Remove redundant access_in_type.
Add otype parm instead of walking binfo.
(friend_accessible_p): Check SCOPE itself.  Handle class
templates.  Pass through otype.
(dfs_accessible_post): Handle all accessibility cases.
(dfs_accessible_pre): New.
(accessible_p): Use it.  Don't check protected access here.  Pass
decl and otype to dfs_walk.
(member_declared_in_type, dfs_access_in_type_pre): New.
(access_in_type): Use dfs_access_in_type_pre.
* friend.c (add_friend): Fix multiple friends with the same name.

From-SVN: r227023
gcc/cp/ChangeLog
gcc/cp/friend.c
gcc/cp/search.c
gcc/testsuite/g++.dg/inherit/access9.C [new file with mode: 0644]