Created on 2022-09-10.00:00:00 last changed 17 months ago
Proposed resolution (approved by CWG 2022-10-07):
Subclause 7.6.2.2 [expr.unary.op] paragraph 10 specifies:
The operand of ~ shall have integral or unscoped enumeration type; the result is the ones' complement of its operand. Integral promotions are performed. The type of the result is the type of the promoted operand. Given the coefficients xi of the base-2 representation (6.8.2 [basic.fundamental]) of the promoted operand x, the coefficient ri of the base-2 representation of the result r is 1 if xi is 0, and 0 otherwise. There is an ambiguity in the grammar...
[Accepted as a DR at the November, 2022 meeting.]
Subclause 7.6.2.2 [expr.unary.op] paragraph 10 specifies:
The operand of ~ shall have integral or unscoped enumeration type; the result is the ones' complement of its operand. Integral promotions are performed. The type of the result is the type of the promoted operand. There is an ambiguity in the grammar...
This should be phrased in terms of the base-2 representation similar to bitwise-AND, instead of alluding to some bit representation by using the term "ones' complement".
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-07-16 13:00:43 | admin | set | status: open -> c++23 |
2023-07-16 13:00:43 | admin | set | status: drwp -> open |
2023-02-18 18:43:04 | admin | set | status: dr -> drwp |
2022-11-25 05:14:04 | admin | set | status: ready -> dr |
2022-10-07 20:33:41 | admin | set | status: open -> ready |
2022-09-10 07:17:47 | admin | set | messages: + msg6933 |
2022-09-10 00:00:00 | admin | create |