This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Possible bug: Template name lookup & overloaded functions.
- From: Simon Hill <yacwroy at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 18 Jan 2010 22:37:34 +1300
- Subject: Possible bug: Template name lookup & overloaded functions.
http://www.gamedev.net/community/forums/topic.asp?topic_id=559287
SOURCE
================================
template <typename pTYPE>
void foo(pTYPE arg)
{ arg.nid(); }
template <typename pTYPE>
void bar()
{
pTYPE var;
foo(var);
}
void foo(int)
{}
int main()
{
int i;
foo(i); // OK: Resolves foo(int).
bar<int>(); // ERROR: Fails to resolve foo(int).
}
===============================
It seems to me now that this is a bug with GCC.
Can someone confirm this please?
See the gamedev.net link for reasoning. I won't duplicate it here.
There's a large number of name lookup bugs in the database but I
couldn't find a matching one.
Thanks.
Simon.