------- Comment #3 from cfairles at gcc dot gnu dot org 2008-12-21 14:22 ------- Hmm, also note that:
template<class T, class U> auto f(T,U) -> decltype(T() + U()) { return T() + U(); } void g(){} int main() { f(2,3.4,&g); } works, as in errors out with no matching function for call to 'f(int, double, void (*)())' Wait wait, this also ICE's template<class T, class U> auto f(T,U) -> decltype(T() + U()) { return T() + U(); } template<class T> void g(T){} int main() { g(f); } so its not that its an extra argument... its that your trying to resolve the type T in the g() call from a function ptr that has an auto return type. -- cfairles at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|[c++0x] ICE when function |[c++0x] ICE when function |type given as extra argument|type given as argument to |to auto return type function|auto return type function http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38597