This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-12-19


1142. friend declaration of member function of containing class

Section: 11.4.2  [class.mfct]     Status: C++11     Submitter: US     Date: 2010-08-02

[Voted into the WP at the November, 2010 meeting.]

N3092 comment US 52

The current wording of 11.4.2 [class.mfct] paragraph 7 allows friend declarations to name member functions “after their class has been defined.” This appears to prohibit a friend declaration in a nested class defined inside its containing class that names a member function of the containing class, because the containing class is still considered to be incomplete at that point.

Proposed resolution (September, 2010):

Change 11.4.2 [class.mfct] paragraph 7 as follows:

Member Previously-declared member functions may be mentioned in friend declarations after their class has been defined.