This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/5458] address of overloaded template function as argument for template
- From: "jwakely dot gcc at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jan 2010 19:00:09 -0000
- Subject: [Bug c++/5458] address of overloaded template function as argument for template
- References: <bug-5458-2793@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #16 from jwakely dot gcc at gmail dot com 2010-01-21 19:00 -------
Shouldn't it get the same error as for this case?
template<class T>
T foo() { return T(); }
int main()
{
&foo;
}
That example can be made valid like so:
int (*pf)() = &foo;
Which demonstrates that the angle brackets are not necessary, *if* the compiler
can determine which specialisation is intended. So the "cannot resolve address
of overloaded function" error is arguably correct.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5458