This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/194: Re: inner class bug in g++
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/194: Re: inner class bug in g++
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Thu, 4 May 2000 08:52:42 +0200
- References: <Pine.SOL.3.91.1000502113639.7998P@cse.cygnus.com>
- Resent-Cc: gcc-prs at gcc dot gnu dot org, mdejong at cygnus dot com
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, "Martin v. Loewis" <martin@loewis.home.cs.tu-berlin.de>
>Number: 194
>Category: c++
>Synopsis: inner class bug in g++ (access check not performed for bases)
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: analyzed
>Class: accepts-illegal
>Submitter-Id: net
>Arrival-Date: Wed May 03 23:56:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Mo DeJong <mdejong@cygnus.com>
>Release: 2.96 20000430
>Organization:
>Environment:
>Description:
Date: Tue, 2 May 2000 11:39:31 -0700 (PDT)
Original-Message-ID: <Pine.SOL.3.91.1000502113639.7998P@cse.cygnus.com>
Hello.
There seems to be a bug all versions of g++ related to
protected inner classes. Here is a small example.
class A {
protected:
class Ai { };
};
class B : public A::Ai { };
g++ compiles this without error, but others compilers correctly
reject the code.
eccp --strict kill.cc
"kill.cc", line 6: error: class "A::Ai" is inaccessible
class B : public A::Ai { };
Here is xlC (vacpp v5) says about this on AIX,
1540-0301: (S) The "protected" member "class A::Ai" cannot be accessed.
I hope that helps.
Mo Dejong
Red Hat Inc.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: