The code is ambiguous.
To build a base C F context is direct initialization, therefore 13.3.1.3 is applied:
C ++ 11
13.3.1.3 Initialization by the constructor [over.match.ctor]
For direct initialization, the candidate function is all the constructors of the initialized object class.
An implicitly declared copy instance is included at 12.8: 8.
Candidates for the C constructor are C(T &) and (the default copy constructor) C(const C &) , according to the parameter list (F) . In both cases, we have a linking (13.3.3.1.4), followed by a conversion with the derived base (13.3.3.1) with additional correction of cv-qualification in the latter case, giving a common conversion rank in both cases.
Since C and T are the base classes of F , but they are different types, and none of them is the base class of the other, none of the provisions in 13.3.3.2.3 and 13.3.3.2-00-00 applied and conversion sequences are indistinguishable.
Indeed, gcc-4.5.1 rejects the code with:
prog.cpp: In constructor 'F::F(const T&)': prog.cpp:20:34: error: call of overloaded 'C(F&)' is ambiguous prog.cpp:9:5: note: candidates are: C::C(T&) prog.cpp:7:1: note: C::C(const C&)
source share