https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71100
Bug ID: 71100
Summary: [6.1 regression] Internal compiler error while calling
a pointer to member function that throws
Product: gcc
Version: 6.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ogoffart at kde dot org
Target Milestone: ---
This code crashes GCC 6.1 when optimisations are enabled:
-----------------------------------------------------------
struct Destr
{ ~Destr(); };
struct XX
{
Destr func() {
throw "throw";
return {};
}
};
inline void call(Destr (XX::*f)(), XX *o)
{
(o->*f)();
}
void f(XX *o) {
call(&XX::func, o);
}
-----------------------------------------------------------
Live demo:
http://melpon.org/wandbox/permlink/GyM44dSdEnvqqmZN