PR libstdc++/86734 make reverse_iterator::operator-> more robust
authorJonathan Wakely <jwakely@redhat.com>
Mon, 30 Jul 2018 17:13:05 +0000 (18:13 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 30 Jul 2018 17:13:05 +0000 (18:13 +0100)
commita64ede727f78b423591995428fbc5a6ac4e72cb0
tree37ba923ab733fac9f1644f112a52cf31d03788e2
parent1b3b888d117da2f0e03d84db1e42749b304ba3b5
PR libstdc++/86734 make reverse_iterator::operator-> more robust

Implement the proposed resolution from LWG 1052, which also resolves
DR 2118 by avoiding taking the address in the first place.

PR libstdc++/86734
* include/bits/stl_iterator.h (reverse_iterator::operator->): Call
_S_to_pointer (LWG 1052, LWG 2118).
(reverse_iterator::_S_to_pointer): Define overloaded helper functions.
* testsuite/24_iterators/reverse_iterator/dr1052.cc: New test.
* testsuite/24_iterators/reverse_iterator/dr2188.cc: New test.

From-SVN: r263074
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_iterator.h
libstdc++-v3/testsuite/24_iterators/reverse_iterator/dr1052.cc [new file with mode: 0644]
libstdc++-v3/testsuite/24_iterators/reverse_iterator/dr2188.cc [new file with mode: 0644]