g++ rejects following code. template<class T> struct B { void foo() { } }; template <class T> struct D: B<int>,B<T> { void bar() { foo(); } // call B<int>::foo() }; int main() { D<void> x; x.bar(); return 0; } ------------------------------------------- $ gcc cc.cpp cc.cpp: In member function 'void D<T>::bar() [with T = void]': cc.cpp:14: instantiated from here cc.cpp:8: error: request for member 'foo' is ambiguous cc.cpp:3: error: candidates are: void B<T>::foo() [with T = void] cc.cpp:3: error: void B<T>::foo() [with T = int]
*** This bug has been marked as a duplicate of 15272 ***