https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78882
Bug ID: 78882 Summary: std::bind not working with templated function Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: lcid-fire at gmx dot net Target Milestone: --- The following does not compile on GCC up to 7 while working fine in clang and icc: #include <functional> #include <string> struct Bar { template <typename T> T* bar(const char*) { return nullptr; } }; struct In { }; template <typename T> auto anonymousWrap(Bar& bar, std::string const& name, const char* other) { auto res = bar.bar<T>(name.c_str()); return res; }; int main() { using namespace std::placeholders; std::bind(anonymousWrap<In>, _1, _2, "other"); return 0; }