https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64329
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code Status|UNCONFIRMED |NEW Last reconfirmed| |2016-04-16 Ever confirmed|0 |1 --- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- Confirming the original report, which is a real bug. N.B. for the different issue in comment 1, G++ will warn but only with -Wsystem-headers, because the problem is inside the <functional> header: /home/jwakely/gcc/6/include/c++/6.0.0/functional:1726:40: warning: returning reference to temporary [-Wreturn-local-addr] std::forward<_ArgTypes>(__args)...); ^