Movatterモバイル変換


[0]ホーム

URL:


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

2025-12-20


500. Access inbase-specifiers of friend and nested classes

Section:11.8.4  [class.friend]    Status:CD1    Submitter:Andreas Hommel    Date:25 Jan 2005

[Voted into WP at the October, 2006 meeting.]

I don't know the reason for this distinction, but it seems to besurprising thatBase::A is legal andD is illegal inthis example:

    class D;    class Base    {        class A;        class B;        friend class D;    };    class Base::B    {    };    class Base::A : public Base::B  // OK because of issue 45    {    };    class D : public Base::B        // illegal because of 11.4p4    {    };

Shouldn't this be consistent (either way)?

Notes from the April, 2005 meeting:

In discussingissue 372, the CWG decidedthat access in thebase-specifiers of a class should be thesame as for its members, and that resolution will applytofriend declarations, as well.

Proposed resolution (October, 2005):

This issue is resolved by the resolution ofissue 372.




[8]ページ先頭

©2009-2026 Movatter.jp