Doc. no. N3567
Date: 2013-03-12
Project: Programming Language C++
Reply to: Ville Voutilainen <ville.voutilainen@gmail.com>

C++ Standard Evolution Closed Issues List (Revision R01)

Revised 2013-03-12 at 16:03:28 UTC

Reference ISO/IEC IS 14882:2003(E)

Also see:

This document contains only evolution issues which have been closed by the Evolution Working Group as duplicates or not defects. That is, issues which have a status of Dup or NAD. See the Evolution Active Issues List active issues and more information. See the Evolution Defect Reports List for issues considered defects. The introductory material in that document also applies to this document.

Revision History

Closed Issues


39. [tiny] local class and friendship

Section: 11.3 [class.friend] Status: NAD Submitter: Gabriel Dos Reis Opened: 2012-11-10 Last modified: 2013-03-09

Discussion:

When we went from C++98 to C++03 we made nested classes implicitly friend of their enclosing classes. We seem to have missed doing the same for local classes defined at member functions scopes.

Mike Miller explained:

Hmm. I think that's already covered by 11p2:

    A member of a class can also access all the names to which the class
    has access.  A local class of a member function may access the same
    names that the member function itself may access.
By the definition of "private" in 11p1, a nested class has access to the private members of the containing class; a member function of the nested class therefore also has access to the private members of the containing class; a local class of such a member function has the same access as the member function; and a member function of the local class has the same access as the local class, the same access as the containing member function, and the same access as the nested class.