https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62052
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |4.10.0, 4.7.4, 4.8.2, 4.9.1
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Smaller testcase that aborts on error instead of printing addresses to stdout:
extern "C" void __attribute((noreturn)) abort();
struct X;
X const* objects[10];
int find(X const* x)
{
for (int i=0; i<10; ++i)
if (objects[i] == x)
return i;
abort();
}
struct X
{
X() {
objects[ find(nullptr) ] = this;
}
X(X const& x) {
find(&x);
objects[ find(nullptr) ] = this;
}
~X() {
objects[ find(this) ] = nullptr;
}
};
int main()
{
auto f = [] (X xx) { return xx; };
X (*ff) (X) = f;
ff ( X{} );
}