-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
EWGEvolutionEvolutionpaper neededAn issue needs a paper to describe its solutionAn issue needs a paper to describe its solution
Description
A friend declaration is a member-declaration, but it is not clear how far the granting of friendship goes in a friend declaration. For example:
class c {
class n {};
friend struct s;
};
struct s {
friend class c::n; // #1
friend c::n g(); // #2
friend void f() { c::n(); } // #3
};
In particular, if a friend function is defined inside the class definition, as in #3, does its definition have access to the private and protected members of the befriending class? Implementations vary on this point.
See CWG1699 for the full discussion.
Metadata
Metadata
Assignees
Labels
EWGEvolutionEvolutionpaper neededAn issue needs a paper to describe its solutionAn issue needs a paper to describe its solution