PR libstdc++/65352
* include/profile/array (array::data): Use _S_ptr.
* include/debug/array (array::data): Likewise.
From-SVN: r223838
2015-05-28 Jonathan Wakely <jwakely@redhat.com>
+ PR libstdc++/65352
+ * include/profile/array (array::data): Use _S_ptr.
+ * include/debug/array (array::data): Likewise.
+
PR libstdc++/65352
* include/std/array (__array_traits::_S_ptr): New function.
(array::data): Use _S_ptr to avoid creating invalid reference.
pointer
data() noexcept
- { return std::__addressof(_AT_Type::_S_ref(_M_elems, 0)); }
+ { return _AT_Type::_S_ptr(_M_elems); }
const_pointer
data() const noexcept
- { return std::__addressof(_AT_Type::_S_ref(_M_elems, 0)); }
+ { return _AT_Type::_S_ptr(_M_elems); }
};
// Array comparisons.
pointer
data() noexcept
- { return std::__addressof(_AT_Type::_S_ref(_M_elems, 0)); }
+ { return _AT_Type::_S_ptr(_M_elems); }
const_pointer
data() const noexcept
- { return std::__addressof(_AT_Type::_S_ref(_M_elems, 0)); }
+ { return _AT_Type::_S_ptr(_M_elems); }
};
// Array comparisons.