http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57575
Bug ID: 57575 Summary: lvalue function accepted as an rvalue Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: anass.lasram at gmail dot com // the following code compiles but it should not float f() { return 0.f; } template<typename F> void take_f(F&& f) {} int main() { // this is OK. reference collapsing take_f(f); // next line compiles but it should not: f is not an rvalue ! take_f<float(void)>(f); return 0; }