https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66957
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> --- Author: jason Date: Thu Aug 20 01:45:49 2015 New Revision: 227023 URL: https://gcc.gnu.org/viewcvs?rev=227023&root=gcc&view=rev Log: 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. Added: trunk/gcc/testsuite/g++.dg/inherit/access9.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/friend.c trunk/gcc/cp/search.c