You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GNU and Clang C++ modes: members skipped by a designated initializer #260
Originally posted by wchilders-nvidia October 9, 2026
Issue Summary
In GNU C++ modes before C++20 and in all Clang C++ modes, a member that was
not designated, but that precedes a designated member, can be zero-initialized
instead of being initialized from its default member initializer.
Reproducing Source Code
struct P { int x = 1, y = 2, z = 3; };
P p = { .x = 10, .z = 30 }; // p.y was is 0. It should be 2.
Command-line Options
cpfe --gnu_version=170100
Type of Issue
[Front End] This code SHOULD compile with these options.
Additional Details
No response
Reproducing (Standard) Configuration(s)
linux-gcc-debug
Reproducing (Non-standard) Configuration
No response
I acknowledge that:
I have checked open issues and existing discussions before filing this report.
The reproducing source code that I have provided does not depend on headers that I have not included with my submission.
I have reduced the reproducing source code to the best of my ability.
I have selected at least one standard configuration or uploaded a non-standard configuration dump.
I understand code shared via this form is NOT confidential.
I have permission to share the reproducing source code and grant permission for the project to use the source code (or derivatives of the source code) to create tests.
I agree that any tests created using the reproducing source code (or deriatives of it) will be licensed under project license unless I included a LICENSE.txt file in my .zip or .tar.gz upload. If I included a LICENSE.txt file, any tests created using the reproducing source code will be governed by the terms of the license I provided instead.
Activity
GNU and Clang C++ mode fix for members skipped by a designated initia…