https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110714
--- Comment #3 from Paul Keir <pkeir at outlook dot com> ---
Actually, there's no need here to delete through the base pointer; so this is
perhaps simpler:
struct Base
{
constexpr Base* get_this() { return this; }
int x;
};
struct Derived : public Base {};
constexpr bool test()
{
Derived* pf = new Derived;
delete static_cast<Derived*>(pf->get_this());
return true;
}
constexpr bool b = test();
