https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93589

--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> ---
No, you've misunderstood. It doesn't mean "can, if the compiler chooses to".
There is no design decision involved.

Types smaller than int *can* be promoted to int, and in certain contexts they
*are* promoted to int. The compiler doesn't get to choose when that happens.

The warning is a false positive because the range of possible values of the RHS
is such that promotion to int and back to short cannot alter the value, but
that doesn't change the fact that there *is* a promotion to int and then
conversion back to short.

Reply via email to