Landing: 34fd4c49fbe6
Project / Subsystem
gcc / c++
Date
2026-08-04
Author
Jason Merrill
Commit
34fd4c49fbe6ff643fc6f5f2cccca03c86535ee0
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- c++
- patch_id
- —
- commit_hash
- 34fd4c49fbe6ff643fc6f5f2cccca03c86535ee0
- source_type
- github
- headline
- C++: Clarify array and class initialization with designators
- tldr
- Improves handling of designated initializers in C++ array and class initialization.
- author
- Jason Merrill
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • c++
- • compiler
- • initialization
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-08-04T00:00:00.000Z
This commit refines how C++ handles designators within initializer lists, particularly for arrays and classes. It clarifies that a designator in reshape_init_r refers to a member of the current type, necessitating a brace elision if it’s not the first initializer. The changes also adjust reshape_init_array_1 and reshape_init_class to correctly interpret designators, ensuring that when a designator is present and the type is a class or array, the initialization is treated as element-specific and not an attempt to initialize the type itself directly.