Skip to content

[Decl.Init.Agg] Arrays of unknown size #469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions specs/language/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,19 @@
initializer list or an expression which generates a value that either is or can
be implicitly converted to an rvalue. Each assignment-expression is an object,
which may be a scalar or aggregate type. A \textit{flattened initializer
sequence} is constructed by a depth-first traversal over each
assignment-expression in an initializer-list and performing a depth-first
traversal accessing each subobject of the assignment-expression.

\p An initializer-list is a valid initializer if for each element \(E_n\) in the
target object's flattened ordering there is a corresponding initializer \(I_n\)
in the flattened initializer sequence which can be implicitly converted to the
element's type.
sequence} is a sequence of expressions constructed by a depth-first traversal
over each assignment-expression in an initializer-list and performing a
depth-first traversal accessing each subobject of the assignment-expression.

\p If the target object is an array of unknown size, the object is assumed to
have \(m\) possible elements during parsing, where \(m>0\).

\p An initializer-list is a valid initializer if for each element
\(E_{n \bmod m}\) in the target object's flattened ordering there is a
corresponding expression \(E_n\) in the flattened initializer sequence, which
can be implicitly converted to the element's type. For arrays of unknown size,
the total number of expressions in the flattened initializer sequence must be a
multiple of the array's base element type.

\p An initializer-list is invalid if the flattened initializer sequence contains
more or fewer elements than the target object's flattened ordering, or if any
Expand Down
Loading