[Bug c++/84701] casting to ( unsigned typeof(variable) ) gives wrong results

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Mar 5 12:13:00 GMT 2018


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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I think this should be rejected, just like:

typedef int T;
unsigned T i;

You can combine unsigned with int (or char, or long, or short) to refer to a
type, but not use it to modify an existing type.

You make_unsigned_t<typeof(s)> to do that.


More information about the Gcc-bugs mailing list