Landing: 9df83006384d

Project / Subsystem

gcc / libstdc++

Date

2026-05-18

Author

Tomasz Kamiński

Commit

9df83006384d5d6dbfc2bb53f090791862f7ed67

Source

github

Perf win

No

Breaking

Yes

All attributes

project
gcc
subsystem
libstdc++
patch_id
commit_hash
9df83006384d5d6dbfc2bb53f090791862f7ed67
source_type
github
headline
libstdc++: Dangling braced-init-list access is now ill-formed.
tldr
Accessing dangling braced-init-list using `std::begin`, `std::end`, and `std::data` is now ill-formed, as per P3016R6.
author
Tomasz Kamiński
outcome
committed
performance_win
false
breaking_change
true
series_id
series_parts
[]
tags
  • libstdc++
  • initializer_list
  • C++26
  • ranges
discussion_id_link
bugzilla_pr
date
2026-05-18T00:00:00.000Z

The libstdc++ now implements section 4.6 of P3016R6. Immediately dangling invocations of std::begin, std::end, and std::data on braced-init-lists are now ill-formed. To keep std::data(il) and std::empty(il) well-formed, the data and empty members are added to initializer_list. Calls to std::rbegin and std::rend remain well-formed due to preserved overloads.