This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54909] gcc does not recognize member function template when identical named pure virtual method exists
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 12 Oct 2012 14:28:00 +0000
- Subject: [Bug c++/54909] gcc does not recognize member function template when identical named pure virtual method exists
- Auto-submitted: auto-generated
- References: <bug-54909-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54909
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-10-12 14:28:00 UTC ---
The example can be reduced to
struct A
{
template<class T> void foo() { }
};
struct B : A
{
void foo(int) { }
};
int main(int, char**)
{
B b;
b.foo<int>(); /* error */
}
An alternative to adding a using declaration is to qualify the function you
want:
b.A::foo<int>();