https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69243
Bug ID: 69243 Summary: std::function summons a non-null pointer out of thin air Product: gcc Version: 5.3.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: --- #include <functional> #include <cassert> struct X { }; int main() { void (X::*mf)() = nullptr; std::function<void(X&)> f = mf; auto tgt = f.target<void (X::*)()>(); assert( tgt == nullptr ); } a.out: ff.cc:11: int main(): Assertion `tgt == nullptr' failed. Aborted (core dumped)