Skip to content

Commit f8600b8

Browse files
burblebeetkoeppe
authored andcommitted
CWG2629 Variables of floating-point type as switch conditions
1 parent acd2c81 commit f8600b8

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

source/statements.tex

+7-6
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,8 @@
100100
declared variable
101101
contextually converted to \tcode{bool}\iref{conv}.
102102
If that
103-
conversion is ill-formed, the program is ill-formed. The value of a
104-
\grammarterm{condition} that is an initialized declaration in a
105-
\keyword{switch} statement is the value of the declared variable if it has
106-
integral or enumeration type, or of that variable implicitly converted
107-
to integral or enumeration type otherwise. The value of a
103+
conversion is ill-formed, the program is ill-formed.
104+
The value of a
108105
\grammarterm{condition} that is an expression is the value of the
109106
expression, contextually converted to \tcode{bool}
110107
for statements other
@@ -412,7 +409,11 @@
412409
several statements depending on the value of a condition.
413410

414411
\pnum
415-
The condition shall be of integral type, enumeration type, or class
412+
The value of a \grammarterm{condition}
413+
that is an initialized declaration
414+
is the value of the declared variable,
415+
or the value of the \grammarterm{expression} otherwise.
416+
The value of the condition shall be of integral type, enumeration type, or class
416417
type. If of class type, the
417418
condition is contextually implicitly converted\iref{conv} to
418419
an integral or enumeration type.

0 commit comments

Comments
 (0)