aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2020-04-03 10:42:20 +0100
committerJonathan Wakely <jwakely@redhat.com>2020-04-03 10:42:20 +0100
commit24fe8c8e338e1c820d942b9c7b997a37705eb29e (patch)
tree65a23ce2fbccca770f58214ecd7c7c277d1abbf2 /gcc
parent2b1e849b35bfe694b09f090397944e11c9f1dc04 (diff)
downloadgcc-24fe8c8e338e1c820d942b9c7b997a37705eb29e.zip
gcc-24fe8c8e338e1c820d942b9c7b997a37705eb29e.tar.gz
gcc-24fe8c8e338e1c820d942b9c7b997a37705eb29e.tar.bz2
libstdc++: Fix std::to_address for debug iterators (PR 93960)
It should be valid to use std::to_address on a past-the-end iterator, but the debug mode iterators do a check for dereferenceable in their operator->(). That check is generally useful, so rather than remove it this changes std::__to_address to identify a debug mode iterator and use base().operator->() to skip the check. PR libstdc++/93960 * include/bits/ptr_traits.h (__to_address): Add special case for debug iterators, to avoid dereferenceable check. * testsuite/20_util/to_address/1_neg.cc: Adjust dg-error line number. * testsuite/20_util/to_address/debug.cc: New test.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions