[Bug libstdc++/69243] New: std::function summons a non-null pointer out of thin air
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jan 12 13:14:00 GMT 2016
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)
More information about the Gcc-bugs
mailing list