On 28/05/15 12:53 +0100, 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.
Tested powerpc64le-linux, committed to trunk.
And gcc-5-branch.
commit 0d999cf16b8f6a0d9bbf4bfe96b29e7b73a259e4
Author: Jonathan Wakely <jwak...@redhat.com>
Date: Thu May 28 12:21:36 2015 +0100
PR libstdc++/65352
* include/std/array (__array_traits::_S_ptr): New function.
(array::data): Use _S_ptr to avoid creating invalid reference.
* testsuite/23_containers/array/tuple_interface/get_neg.cc: Adjust
dg-error line numbers.
* testsuite/23_containers/array/tuple_interface/tuple_element_neg.cc:
likewise.