c++/8500: Allows cast to private base class

bangerth@dealii.org bangerth@dealii.org
Fri Nov 8 06:58:00 GMT 2002


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



More information about the Gcc-bugs mailing list