This is the mail archive of the gcc-bugs@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: c++/8500: Allows cast to private base class


Synopsis: Allows cast to private base class

State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Fri Nov  8 06:58:52 2002
State-Changed-Why:
    Confirmed. Reduced code looks like this:
    ------------------------------
    class Base {};
    
    class Derived : private Base {
       public:
          Derived () : Base() {}
    };
    
    int main(void) {
       Derived* d1 = new Derived;
       Base* b1 = (Base*) d1;
    }
    ----------------------------------
    Note that we get indeed an error if the cast (Base*) is
    removed, but not with it.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8500


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