[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Bug c++/5458] address of overloaded template function as argument for template




------- 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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Reply to: