[Bug libstdc++/122022] bind_front/bind_back/not_fn pass function parameters by value

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Sep 22 14:03:38 GMT 2025


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122022

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
We can make it a rejects-valid testcase instead of a runtime abort:

#include <functional>

struct Obj {
  Obj() = default;
  Obj(const Obj&) = delete;
};

bool f(const Obj&) { return true; }

int main() {
  Obj obj;
  std::bind_front<f>()(obj);
  std::not_fn    <f>()(obj);
}


More information about the Gcc-bugs mailing list