PR libstdc++/86734 make reverse_iterator::operator-> more robust
commita8793a27ca6b503fcb066bc3c6e139904c40fab0
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Jul 2018 17:13:05 +0000 (30 17:13 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Jul 2018 17:13:05 +0000 (30 17:13 +0000)
tree37ba923ab733fac9f1644f112a52cf31d03788e2
parentb7f8b1793a248caf9b71b1a8c0827e62ccde13f4
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263074 138bc75d-0d04-0410-961f-82ee72b054a4
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]