New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[expr.shift] p1 What is the promoted type of a source type to which integral promotion does not apply? #5398
Comments
There are several seemly unconditional uses of integral promotion in the current working draft. Presumably all of them mean that "performs the integral promotion and uses the result if possible, otherwise, uses the original operand or type" (promotion-or-identity). [expr.arith.conv]/(1.5)
[expr.unary.op]/7
[expr.unary.op]/8
[expr.unary.op]/10
[expr.shift]/1
[over.ics.rank]/(4.2)
[over.built]/2
I think we can disambiguate [over.ics.rank]/(4.2) and [over.built]/2 like below:
For the rest, my favorite way is to establish a new term to express the promotion-or-identity semantics. |
I agree that we should just define "promoted operand" as "operand with integral promotions applied, if any". |
Maybe, we should also clarify promoted integral type in a similar manner.
This could interpret why |
[expr.shift] p1 says
Consider this example:
The left operand's type is
long int
whose integer conversion rank is greater thanint
, thus [conv.prom] p1 cannot apply to such a type, as per the following:So, what is the promoted type if the integral promotion does not apply at all? Shall we improve [expr.shift] p1 to the following to clarify this vague?
The text was updated successfully, but these errors were encountered: