From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16536 invoked by alias); 1 Aug 2011 10:06:31 -0000 Received: (qmail 16511 invoked by uid 22791); 1 Aug 2011 10:06:29 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-pz0-f49.google.com (HELO mail-pz0-f49.google.com) (209.85.210.49) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 01 Aug 2011 10:06:15 +0000 Received: by pzk33 with SMTP id 33so11765645pzk.36 for ; Mon, 01 Aug 2011 03:06:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.30.196 with SMTP id u4mr3537151pbh.200.1312193174746; Mon, 01 Aug 2011 03:06:14 -0700 (PDT) Received: by 10.143.7.11 with HTTP; Mon, 1 Aug 2011 03:06:14 -0700 (PDT) In-Reply-To: References: Date: Mon, 01 Aug 2011 10:06:00 -0000 Message-ID: Subject: Re: G++ switch to make everything public in a class? From: Jonathan Wakely To: Ian Lance Taylor Cc: noloader@gmail.com, GCC Users List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-08/txt/msg00005.txt.bz2 On 1 August 2011 02:42, Ian Lance Taylor wrote: > Jeffrey Walton writes: > >> On Sun, Jul 31, 2011 at 2:40 PM, Ian Lance Taylor wrot= e: >>> Jeffrey Walton writes: >>> >>>> Is there a switch to force everything public? >>> >>> -Dprivate=3Dpublic -Dprotected=3Dpublic You might also need -Dclass=3Dstruct >>>> If not, how does one >>>> typically access the non-public stuff for testing? >>> >>> There are a variety of techniques, but this is really a general C++ >>> question, not a gcc question. =A0E.g., search for "c++ testing private >>> methods". >> Thanks Ian. But I'm not clear on why a g++ switch is not gcc help >> related. GCC does have other visibility related switches (eg, >> -Wctor-dtor-privacy). > > Oh, sure, the question about a g++ option is certainly appropriate for > gcc-help, and I answered that part of the question. =A0Using -D options as > I proposed would be equivalent to any option specifically for this > feature, and in fact there is no other option. Except -fno-access-control