[Bug c++/58796] throw nullptr not caught by catch(type*)

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jul 14 14:29:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58796

--- Comment #14 from Jason Merrill <jason at gcc dot gnu.org> ---
Also note that a null pointer to data member is represented as -1, not 0, so
you'll want

  *(ptrdiff_t*)thrown_ptr = -1;

for that case.

A null pointer to member function is { nullptr, 0 }.

You might also handle this in __pbase_type_info::__do_catch rather than
get_adjusted_ptr.


More information about the Gcc-bugs mailing list