This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/30195] New: Using declaration doesn't work in template.
- From: "s__nakayama at infoseek dot jp" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Dec 2006 06:09:38 -0000
- Subject: [Bug c++/30195] New: Using declaration doesn't work in template.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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