This is the mail archive of the gcc-prs@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]

c++/194: Re: inner class bug in g++



>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:

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