Skip to content

Commit 41247dd

Browse files
[Decl.Init.Agg] Arrays of unknown size (#469)
* [Decl.Init.Agg] Arrays of unknown size Add language specification text for arrays of unknown size. * Updates based on PR feedback. * Update to fix mod formatting * Clarify use of the word initializer * Update specs/language/declarations.tex Co-authored-by: Deric C. <[email protected]> --------- Co-authored-by: Deric C. <[email protected]>
1 parent e82253e commit 41247dd

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

specs/language/declarations.tex

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,19 @@
103103
initializer list or an expression which generates a value that either is or can
104104
be implicitly converted to an rvalue. Each assignment-expression is an object,
105105
which may be a scalar or aggregate type. A \textit{flattened initializer
106-
sequence} is constructed by a depth-first traversal over each
107-
assignment-expression in an initializer-list and performing a depth-first
108-
traversal accessing each subobject of the assignment-expression.
109-
110-
\p An initializer-list is a valid initializer if for each element \(E_n\) in the
111-
target object's flattened ordering there is a corresponding initializer \(I_n\)
112-
in the flattened initializer sequence which can be implicitly converted to the
113-
element's type.
106+
sequence} is a sequence of expressions constructed by a depth-first traversal
107+
over each assignment-expression in an initializer-list and performing a
108+
depth-first traversal accessing each subobject of the assignment-expression.
109+
110+
\p If the target object is an array of unknown size, the object is assumed to
111+
have \(m\) possible elements during parsing, where \(m>0\).
112+
113+
\p An initializer-list is a valid initializer if for each element
114+
\(E_{n \bmod m}\) in the target object's flattened ordering there is a
115+
corresponding expression \(E_n\) in the flattened initializer sequence, which
116+
can be implicitly converted to the element's type. For arrays of unknown size,
117+
the total number of expressions in the flattened initializer sequence must be a
118+
multiple of the array's base element type.
114119

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

0 commit comments

Comments
 (0)