------- Comment #4 from syntheticpp at gmx dot net  2009-01-15 18:56 -------
It has nothing to do with templates.

This code still compiles:

struct P 
{
protected:
    P() {}
    P(const P&) {}
};

struct B : protected P
{
    B() {}
};

struct C : public P
{
    C(const B& b) : P(b) {}
};

void foo()
{
    B b;
    C c(b);

    //P p(b); // <-- compiler error
}

But I it should not, because only within the scope of B
B "is a" P. Globally B "is not a" P. Therefore you can't pass
a instance of B in a scope different to B to the constructor 
of P. 
Even when C inherits from P the struct B is still "not a" P
in the scope of C.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38579

Reply via email to