This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: G++ switch to make everything public in a class?
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: noloader at gmail dot com, GCC Users List <gcc-help at gcc dot gnu dot org>
- Date: Mon, 1 Aug 2011 11:06:14 +0100
- Subject: Re: G++ switch to make everything public in a class?
- References: <CAH8yC8mGpfrt+O6=ias2qkfT+eu=pMDhPbWLkZjJz2BymX0aNA@mail.gmail.com> <mcrr55647kz.fsf@coign.corp.google.com> <CAH8yC8ny+z1atBfP4pkn016J2c2Ykxjn813XE45tFKOL+Mc_zQ@mail.gmail.com> <mcrfwll52mc.fsf@coign.corp.google.com>
On 1 August 2011 02:42, Ian Lance Taylor wrote:
> Jeffrey Walton <noloader@gmail.com> writes:
>
>> On Sun, Jul 31, 2011 at 2:40 PM, Ian Lance Taylor <iant@google.com> wrote:
>>> Jeffrey Walton <noloader@gmail.com> writes:
>>>
>>>> Is there a switch to force everything public?
>>>
>>> -Dprivate=public -Dprotected=public
You might also need -Dclass=struct
>>>> 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. ?E.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. ?Using -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