https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87571
Alexandre Oliva <aoliva at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2018-11-28 CC| |aoliva at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Alexandre Oliva <aoliva at gcc dot gnu.org> --- The reason private works where protected doesn't is that private access checking uses is_friend, whereas protected access checking uses friend_accessible_p. The latter is supposed to grant access whenever is_friend would (that's the assert that fails), but while is_friend checks various possibilities of template specialization with is_specialization_of_friend, friend_accessible_p seems to only handle one layer of template friends. I'm afraid I don't quite see how to extend e.g. protected_accessible_p, used by friend_accessible_p, to deal with additional template layers.