From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26605 invoked by alias); 8 Nov 2002 20:06:04 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 26542 invoked by uid 71); 8 Nov 2002 20:06:03 -0000 Date: Fri, 08 Nov 2002 12:06:00 -0000 Message-ID: <20021108200603.26532.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Wolfgang Bangerth Subject: Re: c++/8500: Allows cast to private base class Reply-To: Wolfgang Bangerth X-SW-Source: 2002-11/txt/msg00427.txt.bz2 List-Id: The following reply was made to PR c++/8500; it has been noted by GNATS. From: Wolfgang Bangerth To: "Harald H. Soleng" Cc: gcc-gnats@gcc.gnu.org Subject: Re: c++/8500: Allows cast to private base class Date: Fri, 8 Nov 2002 14:03:20 -0600 (CST) > You should not get an error with old style c-casting. > However, with > > Base* b1 = static_cast d1; > > on the second line of main you should. Here is the error message from > the native Sun CC compiler: > "Error: Using static_cast to convert from Derived* to Base* not allowed." Uhm, I don't think you can work around access control rules just by using a C-style cast over a static_cast, can you? Regards W. ------------------------------------------------------------------------- Wolfgang Bangerth email: bangerth@ticam.utexas.edu www: http://www.ticam.utexas.edu/~bangerth