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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> I suppose the C++ standard says static_cast<Derived *>(nullptr) == nullptr
> and
> we literally follow that.  Note it will make a difference for very large
> objects (and thus very large offsets added) which may end up acccessing
> actually
> mapped memory so IMHO what clang does by default is a security risk.

Is that any worse than this though?

LargeObject* p = nullptr;
p->foo();

Adding a static_cast doesn't seem to be the problem here.

Reply via email to