]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Change [range.iter.op] functions to function objects [PR 100768]
authorJonathan Wakely <jwakely@redhat.com>
Wed, 26 May 2021 16:32:53 +0000 (17:32 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 26 May 2021 18:15:34 +0000 (19:15 +0100)
commita49a045b92f982f5617c3bbde97a33157237e25b
treeca296da21c602e87ce31d7f632fb834a373cae7a
parent7f0cfeb1ac580edf629874146b349fe7ad7e7718
libstdc++: Change [range.iter.op] functions to function objects [PR 100768]

The standard specifies std::ranges::distance etc as function templates,
but it also requires them to not be found by ADL, and to suppress ADL
when normal unqualified lookup does find them. That means they need to
be function objects.

libstdc++-v3/ChangeLog:

PR libstdc++/100768
* include/bits/ranges_base.h (advance, distance, next, prev):
Replace function templates with function objects.
* testsuite/24_iterators/headers/iterator/synopsis_c++20.cc:
Adjust for changes to function objects.
* testsuite/std/ranges/adaptors/elements.cc: Add using
declarations for names from namespace ranges.
* testsuite/std/ranges/adaptors/transform.cc: Likewise.
* testsuite/24_iterators/range_operations/100768.cc: New test.
libstdc++-v3/include/bits/ranges_base.h
libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++20.cc
libstdc++-v3/testsuite/24_iterators/range_operations/100768.cc [new file with mode: 0644]
libstdc++-v3/testsuite/std/ranges/adaptors/elements.cc
libstdc++-v3/testsuite/std/ranges/adaptors/transform.cc