Title
Conversion of bool to signed integer of width 1
Status
tentatively ready
Section
7.3.9 [conv.integral]
Submitter
Janet Cobb

Created on 2023-07-15.00:00:00 last changed yesterday

Messages

Date: 2026-09-03.23:06:47

Proposed resolution (approved by CWG 2026-09-01):

Change in 7.3.9 [conv.integral] paragraph 2 and paragraph 3 as follows:

If the destination type is bool, see 7.3.15 [conv.bool]. If the source type is bool, the value false is converted to zero and the value true is converted to one source integer value is considered to be zero if the value is false and one otherwise.

Otherwise, the The result is the unique value of the destination type that is congruent to the source integer value modulo 2^N, where N is the width of the destination type.

Date: 2023-07-15.00:00:00

(From submission #365.)

According to 6.9.3 [basic.fundamental] paragraph 1, a signed integer of width 1 can represent the values -1 and 0. It is unclear how the boolean-to-integer conversion (7.3.9 [conv.integral]) works for such a situation.

History
Date User Action Args
2026-09-03 23:06:47adminsetstatus: open -> tentatively ready
2026-08-30 06:57:42adminsetmessages: + msg8666
2023-07-15 00:00:00admincreate