This is the mail archive of the
mailing list for the GCC project.
RE: Nested Class Member Access
- From: "Steven L. Zook" <SLZook at Qualstar dot com>
- To: "Florian Weimer" <fw at deneb dot enyo dot de>
- Cc: "GCC Mailing List \(E-mail\)" <gcc at gcc dot gnu dot org>
- Date: Fri, 3 Sep 2004 08:35:53 -0700
- Subject: RE: Nested Class Member Access
Is this behavior on GCC's part (that is, nested classes are members of the enclosing class and thus have all access rights that other members have) intentional?
If so, should it be documented in the "Extensions to the C++ Language" section of the GCC online documents.
In any case, it seems that I should not submit a problem report.
From: Florian Weimer [mailto:email@example.com]
Sent: Thursday, September 02, 2004 12:23 PM
To: Steven L. Zook
Cc: GCC Mailing List (E-mail)
Subject: Re: Nested Class Member Access
* Steven L. Zook:
> According to ISO/IEC 14882-2003 (is this the correct standard for
> GCC?) 11.8.1 [class.access.nest], I believe this should be an
> error. The paragraph says that nested classes have no special access
> rights to enclosing class members. Since cOuter::Variable is
> private, cOuter::cInner::Function should not have access to it.
Your are correct that your example is not valid C++, but this may