From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7614 invoked by alias); 12 Sep 2003 16:46:28 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 7607 invoked by uid 48); 12 Sep 2003 16:46:27 -0000 Date: Fri, 12 Sep 2003 17:14:00 -0000 Message-ID: <20030912164627.7606.qmail@sources.redhat.com> From: "nathan at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20030912163500.12265.olau@hardworking.dk> References: <20030912163500.12265.olau@hardworking.dk> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/12265] Downcast to class which derives privately rejected X-Bugzilla-Reason: CC X-SW-Source: 2003-09/txt/msg00991.txt.bz2 List-Id: PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12265 nathan at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID ------- Additional Comments From nathan at gcc dot gnu dot org 2003-09-12 16:46 ------- not a bug. the cast is invalid. [5.2.9]/5 says it is ok if there's a standard conversion from derived to base.[4.10]/3 says there's a conversion, but if the base is inaccessible or ambiguous, the program is ill-formed. [11.2]/4 says a base is accessible if an invented public member of the base class is accessible. members of Base, such as Base::f have no special access to the provate bases of Derived, so the base is inaccessible in Base::f. If the cast were in a member or friend of Derived, it would be ok.