As noted in a Praetorian comment, the problem is with the default T() value. Based on the error data, using base::T seems to confuse the compiler in finding T() as calling a non-static base member function, rather than building an instance of type T
Here's an interesting fix that works in MSVC 2005 x86 (I haven't tried any other compiler yet). Note that T() saved. This either removes the ambiguity of using base::T , or simply causes T to refer to the inherited type, not to using (which, apparently, is not the same for the compiler).
//... template<class> struct derived : base { using base::T; derived(T = static_cast<T>( T() )) { } //No error }; //...
Edit: try changing the base to this and see what error messages you get:
struct base { struct T{T(){}}; };
I get the original C2597 , but also this one:
error C2440: "default argument": cannot be converted from '' to 'base :: T' The constructor cannot use the source type, or the resolution of the constructor overload was ambiguous.
I don't know what the compiler means, '' but this is probably a similar problem with the original base definition. This compiles if I delete the line using base::T; .
source share