https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79798
Bug ID: 79798 Summary: [7 Regression] std::bind uses wrong value category with result_of Product: gcc Version: 7.0.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- Another case like PR 79486, this fails to compile with trunk: #include <functional> struct X { }; const X f(int); struct Y { void operator()(X&&) = delete; int operator()(const X&&); }; auto b = std::bind(Y(), std::bind(f, std::placeholders::_1)); auto i = b(1); x.cc:12:13: error: no match for call to ‘(std::_Bind<Y(std::_Bind<const X (*(std::_Placeholder<1>))(int)>)>) (int)’ auto i = b(1); ^