test case template<class T> struct B { void foo(T) {} };
template<class T> struct D: B<int>, B<double> { using B<int>::foo; using B<double>::foo; void bar() { foo(3); } }; int main() { D<int> x; x.bar(); return 0; } $g++ cc.cpp cc.cpp: In member function 'void D<T>::bar()': cc.cpp:10: error: reference to 'foo' is ambiguous cc.cpp:3: error: candidates are: void B<T>::foo(T) [with T = double] cc.cpp:3: error: void B<T>::foo(T) [with T = int] cc.cpp:10: error: reference to 'foo' is ambiguous cc.cpp:3: error: candidates are: void B<T>::foo(T) [with T = double] cc.cpp:3: error: void B<T>::foo(T) [with T = int] -- Summary: Using declaration doesn't work in template. Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: s__nakayama at infoseek dot jp http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30195