On Thu, 28 May 2015, Jonathan Wakely wrote:

Unsurprisingly ubsan doesn't like referencing a null pointer.

With this change __array_traits::_S_ref is only used to access an
element, which is invalid for std::array<T, 0> anyway.

Should

return *static_cast<_Tp*>(nullptr);

be replaced with

__builtin_unreachable();

then? It seems strange to keep an implementation that is never supposed to be used.

--
Marc Glisse

Reply via email to