Skip to content

Commit 4eaaf74

Browse files
ntreldlang-bot
authored andcommitted
Fix Issue 18496 - Complement expressions now actually int promote
Also document promotion before unary `-` and `+`.
1 parent 1dbbde6 commit 4eaaf74

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

spec/expression.dd

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,9 @@ $(TABLE
991991
$(TROW `!`, Logical NOT)
992992
)
993993

994+
$(P The usual $(INTEGER_PROMOTIONS) are performed prior to unary
995+
`-` and `+` operations.)
996+
994997
$(H3 $(LNAME2 complement_expressions, Complement Expressions))
995998

996999
$(GRAMMAR
@@ -1000,9 +1003,7 @@ $(GNAME ComplementExpression):
10001003

10011004
$(P $(I ComplementExpression)s work on integral types (except $(D bool)).
10021005
All the bits in the value are complemented.
1003-
)
1004-
1005-
$(P $(B Note:) the usual $(INTEGER_PROMOTIONS) are not performed
1006+
The usual $(INTEGER_PROMOTIONS) are performed
10061007
prior to the complement operation.
10071008
)
10081009

0 commit comments

Comments
 (0)