https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102084
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- With -fsanitize=undefined I get: /opt/compiler-explorer/gcc-trunk-20210826/include/c++/12.0.0/bits/invoke.h:116:38: runtime error: reference binding to null pointer of type 'const double' /opt/compiler-explorer/gcc-trunk-20210826/include/c++/12.0.0/bits/std_function.h:292:44: runtime error: reference binding to null pointer of type 'const double' /app/example.cpp:24:43: runtime error: load of null pointer of type 'const double'