Skip to content

Commit 9539ea7

Browse files
burblebeetkoeppe
authored andcommitted
CWG2768 Assignment to enumeration variable with a braced-init-list
1 parent 36a989c commit 9539ea7

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

source/expressions.tex

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7254,17 +7254,22 @@
72547254
\end{note}
72557255

72567256
\pnum
7257-
A \grammarterm{braced-init-list} may appear on the right-hand side of
7257+
A \grammarterm{braced-init-list} $B$ may appear on the right-hand side of
7258+
72587259
\begin{itemize}
7259-
\item an assignment to a scalar, in which case the initializer list shall have
7260-
at most a single element. The meaning of \tcode{x = \{v\}}, where \tcode{T} is the
7261-
scalar type of the expression \tcode{x}, is that of \tcode{x = T\{v\}}. The meaning of
7262-
\tcode{x = \{\}} is \tcode{x = T\{\}}.
7260+
\item
7261+
an assignment to a scalar of type \tcode{T}, in which case $B$
7262+
shall have at most a single element.
7263+
The meaning of \tcode{x = $B$} is \tcode{x = t},
7264+
where \tcode{t} is an invented temporary variable
7265+
declared and initialized as \tcode{T t = $B$}.
72637266

7264-
\item an assignment to an object of class type, in which case the initializer
7265-
list is passed as the argument to the assignment operator function selected by
7267+
\item
7268+
an assignment to an object of class type, in which case $B$
7269+
is passed as the argument to the assignment operator function selected by
72667270
overload resolution\iref{over.ass,over.match}.
72677271
\end{itemize}
7272+
72687273
\begin{example}
72697274
\begin{codeblock}
72707275
complex<double> z;

0 commit comments

Comments
 (0)