This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/43506] name lookup fails in function template
- From: "yao_yin at 163 dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Mar 2010 01:56:19 -0000
- Subject: [Bug c++/43506] name lookup fails in function template
- References: <bug-43506-9853@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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