This error message: error: type 'type1' is not derived from 'type2' is rather unclear. The first reaction is to look at the source, see that indeed, type1 is not derived from type2, and say "... and why does that matter?!" Source: template < typename A > struct B { typedef int C; }; template < typename A > struct D { struct E { B < A >::C f; }; }; 6: error: type 'B<A>' is not derived from type 'D<A>::E' 6: error: expected ';' before 'f' The problem here is that there should be a 'typename' before 'B<A>::C', but the error message contains no hint of that, in addition to missing any hint of why the compiler would expect a derived type here anyway.
The error message on 4.5.x, 4.6.x and mainline seems pretty good to me: 43275.C:6:5: error: need ‘typename’ before ‘B<A>::C’ because ‘B<A>’ is a dependent scope