FRIDAY, JULY 31, 2026
c++/parser
C++: Defer parsing of initializer lists in complete class contexts.
C++ parser now defers init-list parsing in complete class contexts to fix bug PR126481.
The C++ parser defers parsing of initializer lists ({}) when they appear in a complete class context. Previously, the parser incorrectly assumed that only ‘this’ usage and name lookup could necessitate deferred parsing in such scenarios. This change corrects that assumption, resolving a bug where init-lists caused parsing issues.
In Details
The C++ frontend parser in parser.cc now defers parsing of brace-enclosed initializer lists within class definitions. This corrects an oversight where such constructs, similar to 'this' usage, require delayed processing to handle scopes and names correctly, specifically addressing PR126481.
For Context
- initializer list
- A C++ construct used to initialize objects, often with a brace-enclosed list of values. In this context, it refers to initializing members of a class.
- complete class context
- A state in C++ parsing where the definition of a class is fully known, including all its members and their types.