prog.cpp: In function 'int main()':
prog.cpp:14:13: error: no matching function for call to 'f(int)'
return f(0);
^
prog.cpp:7:6: note: candidate: template<class T> decltype (g(v)) f(T)
auto f(T v) -> decltype(g(v))
^
prog.cpp:7:6: note: template argument deduction/substitution failed:
prog.cpp: In substitution of 'template<class T> decltype (g(v)) f(T) [with T = int]':
prog.cpp:14:13: required from here
prog.cpp:2:26: error: 'g' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
auto f(T v) -> decltype(g(v));
^
prog.cpp:4:5: note: 'int g(int)' declared here, later in the translation unit
int g(int) { return 0; }
^