Landing: 1a4d8dc0d2dc

Project / Subsystem

gcc / libstdc++

Date

2026-07-07

Author

Tomasz Kamiński

Commit

1a4d8dc0d2dc045bbb93654ae66fb80276dc6690

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
libstdc++
patch_id
commit_hash
1a4d8dc0d2dc045bbb93654ae66fb80276dc6690
source_type
github
headline
Libstdc++ asserts layout_stride::mapping uniqueness.
tldr
Libstdc++ adds assertions to ensure unique layout_stride::mapping combinations.
author
Tomasz Kamiński
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • libstdc++
  • mdspan
  • assertions
discussion_id_link
bugzilla_pr
date
2026-07-07T00:00:00.000Z

Libstdc++ now asserts that the combination of strides and extents passed to layout_stride::mapping is unique. For performance in non-debug builds, only O(rank) checks are performed, while debug builds include an O(rank^2) check using an insertion-sort-based algorithm. This change also ensures consistent behavior for layout_stride mapping construction, aligning with LWG4603.