We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a66f972 commit e8211d7Copy full SHA for e8211d7
src/frontc/cabs2cil.ml
@@ -4020,8 +4020,17 @@ and doExp (asconst: bool) (* This expression is used as a constant *)
4020
else
4021
E.s (error "Unary ~ on a non-integral type")
4022
4023
- | A.UNARY(A.PLUS, e) -> doExp asconst e what
4024
-
+ | A.UNARY(A.PLUS, e) ->
+ let (se, e', t) = doExp asconst e (AExp None) in
4025
+ if isIntegralType t then
4026
+ let tres = integralPromotion t in
4027
+ let e'' = makeCastT ~e:e' ~oldt:t ~newt:tres in
4028
+ finishExp se e'' tres
4029
+ else
4030
+ if isArithmeticType t then
4031
+ finishExp se e' t
4032
4033
+ E.s (error "Unary + on a non-arithmetic type")
4034
4035
| A.UNARY(A.ADDROF, e) -> begin
4036
match e with
0 commit comments