This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/6974: g++ 3.1 accesses private typedef of base class
- From: peter dot klotz at aon dot at
- To: gcc-gnats at gcc dot gnu dot org
- Date: 9 Jun 2002 06:35:49 -0000
- Subject: c++/6974: g++ 3.1 accesses private typedef of base class
- Reply-to: peter dot klotz at aon dot at
>Number: 6974
>Category: c++
>Synopsis: g++ 3.1 accesses private typedef of base class
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: accepts-illegal
>Submitter-Id: net
>Arrival-Date: Sat Jun 08 23:36:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: peter.klotz@aon.at
>Release: unknown-1.0
>Organization:
>Environment:
Red Hat Linux 7.3 with gcc 3.1-1 packages from Red Hat
>Description:
The compiler processes the attached code without error although the typedef in class Base is private and therefore inaccessible from class Derived.
The code should not compile.
>How-To-Repeat:
g++ -W -Wall private_typdef.cpp -o private_typedef
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="private_typedef.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="private_typedef.cpp"
I2luY2x1ZGUgPGxpc3Q+CiNpbmNsdWRlIDxzdHJpbmc+Cgp0ZW1wbGF0ZTx0eXBlbmFtZSBUPgpj
bGFzcyBCYXNlCnsKcHJpdmF0ZToKICAgIHR5cGVkZWYgVCBUVDsKfTsKCnRlbXBsYXRlPHR5cGVu
YW1lIFQ+CmNsYXNzIERlcml2ZWQgOiBwdWJsaWMgQmFzZTxUPgp7CnByb3RlY3RlZDoKICAgIHR5
cGVkZWYgdHlwZW5hbWUgQmFzZTxUPjo6VFQgVFQ7IC8vIHR5cGVkZWYgVFQgaW4gY2xhc3MgQmFz
ZSBpcyBwcml2YXRlIQpwdWJsaWM6CiAgICB2b2lkIGYoKQogICAgewogICAgICAgIHN0ZDo6bGlz
dDxUVD4gbDsKICAgIH0KfTsKCmludCBtYWluKHZvaWQpCnsKICAgIERlcml2ZWQ8c3RkOjpzdHJp
bmc+KCkuZigpOwogICAgcmV0dXJuIDA7Cn0KCgo=