Landing: 0bcb57a2294f

Project / Subsystem

gcc / libstdc++

Date

2026-07-03

Author

Tomasz Kamiński

Commit

0bcb57a2294fbadfa8388bdc3a5be356ad3cf91c

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
libstdc++
patch_id
commit_hash
0bcb57a2294fbadfa8388bdc3a5be356ad3cf91c
source_type
github
headline
libstdc++ validates stride values for layout_stride
tldr
layout_stride now validates user-provided strides to prevent negative or unrepresentable values, improving robustness.
author
Tomasz Kamiński
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • libstdc++
  • mdspan
  • validation
discussion_id_link
bugzilla_pr
date
2026-07-03T00:00:00.000Z

The layout_stride class in libstdc++ now validates user-provided stride values. The conversion of these strides using __index_type_cast now includes assertions to ensure they are non-negative and fit within the index_type, preventing potential errors and undefined behavior. A new test case stride_neg.cc has been added to verify this validation.