diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2024-09-04 21:31:58 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2024-09-15 16:20:58 +0100 |
commit | 2af87d98e66e57d51f36220de983eff44bae98c8 (patch) | |
tree | 6ac02dfe989b7718366c150460a84dad99fd6305 /gcc/cp | |
parent | 1dde83f0ec313166fc91e6784a0ca2e3db46acee (diff) | |
download | gcc-2af87d98e66e57d51f36220de983eff44bae98c8.zip gcc-2af87d98e66e57d51f36220de983eff44bae98c8.tar.gz gcc-2af87d98e66e57d51f36220de983eff44bae98c8.tar.bz2 |
libstdc++: Adjust std::span::iterator to be ADL-proof
Because std::span<Incomplete> can be useful, it makes sense to define
std::span<Incomplete>::iterator such that Incomplete is not an
associated class, and so the compiler won't attempt to complete it when
doing ADL for span iterators (including during the definition of
std::span<Incomplete>::const_iterator which checks that iterator
satisfies std::input_or_output_iterator).
We can't make this change for std::vector<Incomplete> because it would
change the mangled name of std::vector<Incomplete>::iterator which would
affect the mangled names of templates and functions written by users.
We can do the same thing for std::basic_stacktrace<Alloc> just so that
Alloc is not an associated class. This is probably less beneficial, as
Alloc can't be incomplete, and using SomeAllocator<Incomplete> as the
allocator parameter doesn't seem useful. But simply making the
stacktrace iterator not use Alloc for ADL lookup seems worthwhile. This
is doable because std::stacktrace is part of C++23 so its ABI isn't
considered stable yet.
libstdc++-v3/ChangeLog:
* include/std/span (span::__iter_tag): Declare nested type.
(span::iterator): Use __iter_tag as second template argument.
* include/std/stacktrace (basic_stacktrace::iterator): Use _Impl
as second template argument.
Diffstat (limited to 'gcc/cp')
0 files changed, 0 insertions, 0 deletions