[Bug c++/89722] [8/9 regression] strange warning: type qualifiers ignored on cast result type [-Wignored-qualifiers]
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Mar 15 13:06:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89722
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2019-03-15
Ever confirmed|0 |1
--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Xavier from comment #9)
> We are compiling with -std=gnu++98 so decltype is not available there.
But __decltype is.
> And the "+ 0" trick does not seem to work correctly.
It will cause integer promotion for types with smaller rank than int.
> Do you have a solution that works with -std=gnu++98 ?
__decltype
But I think we want to suppress the warning for (__typeof__(expr))x
(we do still want to strip the qualifiers from the result type, just not warn).
More information about the Gcc-bugs
mailing list