This is the mail archive of the gcc-bugs@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]

[Bug c++/43506] name lookup fails in function template



------- Comment #7 from yao_yin at 163 dot com  2010-03-29 01:56 -------
Sorry, I gave a wrong example..

In fact, the code in PR 29131:
template<class T>
int t(T i)
{
  return f (i);  // OK, with g++ 4.4.3
}

int
f (int i)
{
  return i;
}

int
main()
{
  return t(1);
}

can be compiled with g++ 4.4.3

but the following code cannot:

template<class T>
int f(int k, T i)
{
  return f(i);  // error: f not visible here
}

int
f (int i) // overload
{
  return i;
}

int
main()
{
  return f(1, 2);
}


-- 

yao_yin at 163 dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43506


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