legal C++ ?

Steve Ellcey sje@cup.hp.com
Wed Oct 6 20:19:00 GMT 2004


The following program compiles with the latest g++ but not with a couple
of other C++ compilers I tried.  It seems like g++ should not be accepting
this, is this a bug?  Should I submit a bug report against g++?

class A {
public:
     void l();
     friend class C;
};
class B : protected A {
};
class C {
     void v(B * g) { g->l(); }
};

Steve Ellcey
sje@cup.hp.com



More information about the Gcc mailing list