]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Prepare mapping layout tests for padded layouts.
authorLuc Grosheintz <luc.grosheintz@gmail.com>
Tue, 23 Sep 2025 13:10:03 +0000 (15:10 +0200)
committerTomasz Kamiński <tkaminsk@redhat.com>
Thu, 25 Sep 2025 13:40:19 +0000 (15:40 +0200)
commit181e7bea46ceb0ee2c5ee2d95dab7ff97158d7b3
treeeeee3900b257e2368896048032faf1a0d8465c23
parent4f9f1269f4e929ee471b717b47c33d2d5a3db0d3
libstdc++: Prepare mapping layout tests for padded layouts.

Using the existing tests for padded layouts requires the following
changes:

 * The padded layouts are template classes. In order to be able to use
   partially specialized templates, functions need to be converted to
   structs.

 * The layout mapping tests include a check that only applies if
   is_exhaustive is static. This commit introduces a concept to check if
   is_exhaustive is a static member function.

 * Fix a test to not use a hard-coded layout_left.

The test empty.cc contains indentation mistakes that are fixed.

libstdc++-v3/ChangeLog:

* testsuite/23_containers/mdspan/layouts/empty.cc: Fix indent.
* testsuite/23_containers/mdspan/layouts/mapping.cc
(test_stride_1d): Fix test.
(test_stride_2d): Rewrite using a struct.
(test_stride_3d): Ditto.
(has_static_is_exhaustive): New concept.
(test_mapping_properties): Update test.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
libstdc++-v3/testsuite/23_containers/mdspan/layouts/empty.cc
libstdc++-v3/testsuite/23_containers/mdspan/layouts/mapping.cc