This is the second iteration of:
https://gcc.gnu.org/pipermail/libstdc++/2025-July/062315.html
These patches can be applied cleanly after the dims patch; but might
conflict if applied before.
The changes include:
- After discussion on the mailling list [1], the feature testing macro
for is_sufficiently_aligned was added to
20_util/headers/memory/version.cc
The 20_util tests were run with GLIBCXX_TESTSUITE_STDS=17,20,23,26.
- The features testing macro for aligned_accessor was added to
mdspan/version.cc
- The debug assertions for alignedness of the pointer passed to
access and offset were removed, but the tests were retained.
- Strengthen one test to check non-constructible (instead of not
convertible).
- Use the PR number in commits and this time sign-off on all of them
(sorry!).
[1]: https://gcc.gnu.org/pipermail/libstdc++/2025-July/062628.html
Luc Grosheintz (3):
libstdc++: Implement is_sufficiently_aligned [PR120994]
libstdc++: Prepare test code for default_accessor for reuse.
libstdc++: Implement aligned_accessor from mdspan [PR120994]
libstdc++-v3/include/bits/align.h | 16 ++
libstdc++-v3/include/bits/version.def | 18 ++
libstdc++-v3/include/bits/version.h | 20 +++
libstdc++-v3/include/std/mdspan | 68 +++++++
libstdc++-v3/include/std/memory | 1 +
libstdc++-v3/src/c++23/std.cc.in | 7 +-
.../20_util/headers/memory/version.cc | 5 +
.../20_util/is_sufficiently_aligned/1.cc | 31 ++++
.../23_containers/mdspan/accessors/aligned.cc | 43 +++++
.../mdspan/accessors/aligned_neg.cc | 33 ++++
.../accessors/debug/aligned_access_neg.cc | 23 +++
.../accessors/debug/aligned_offset_neg.cc | 23 +++
.../23_containers/mdspan/accessors/default.cc | 99 -----------
.../23_containers/mdspan/accessors/generic.cc | 168 ++++++++++++++++++
.../testsuite/23_containers/mdspan/version.cc | 8 +
15 files changed, 462 insertions(+), 101 deletions(-)
create mode 100644 libstdc++-v3/testsuite/20_util/is_sufficiently_aligned/1.cc
create mode 100644
libstdc++-v3/testsuite/23_containers/mdspan/accessors/aligned.cc
create mode 100644
libstdc++-v3/testsuite/23_containers/mdspan/accessors/aligned_neg.cc
create mode 100644
libstdc++-v3/testsuite/23_containers/mdspan/accessors/debug/aligned_access_neg.cc
create mode 100644
libstdc++-v3/testsuite/23_containers/mdspan/accessors/debug/aligned_offset_neg.cc
delete mode 100644
libstdc++-v3/testsuite/23_containers/mdspan/accessors/default.cc
create mode 100644
libstdc++-v3/testsuite/23_containers/mdspan/accessors/generic.cc
--
2.50.0