This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]