I obtain different results from dynamic_cast when using different compilers
<p>The assertion in the following program gives different results according to the compiler used: in GCC 4.4 the assertions fails, while in CLang does not. It looks like GCC does not like V being private in C. Is this a bug?</p>

<pre><code>#include &lt;cassert&gt;

class V {
public:
    virtual ~V() { };
};

template&lt;class T&gt;
class C : public T, private V {
public:
    static V* new_() {
        return new C();
    }
};

struct MyT {
};

typedef C&lt;MyT&gt; C_MyT;

int main(int argc, char** argv) {
    V* o2 = C_MyT::new_();
    assert(dynamic_cast&lt;C_MyT*&gt; (o2)); // failure in GCC, success in CLang
    return 0;
}
</code></pre>
