This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: default access for class/struct bug?


Hi,

On Mon, 11 Feb 2002, Paolo Carlini wrote:

> Hi. I'm not a language lawyer but it looks like the EDG front end
> gives you reason: it compiles the testcase in "strict" mode too...

Bah.  I should have tested this myself.  Silly me ;-)  Thanks.

> > (when it's changed to #if 0 it of course works).  Now the standard says
> > (if I read it correctly) (11.2), that the default access right of members
> > depends on the _definition_ not declaration of a class.
>
> ... however I cannot find explicit reference to definition vs
> declaration in 11.2, which seems to me more about member access
> control in inheritance. Could you please be more specific?

11 Member access control [class.access]

2 Members of a class _defined_ with the keyword class are private by
  default.  Members of a class _defined_ with the keywords struct or union
  are public by default.

(Emphasis mine)


Ciao,
Michael.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]