This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCH for c++/87519 - bogus warning with -Wsign-conversion


On 8/8/19 10:50 AM, Marek Polacek wrote:
This PR complains about bogus -Wsign-conversion warning even with an
explicit cast, which the documentation says should suppress the warning.
Pretty similar to c++/86190 which I fixed here
<https://gcc.gnu.org/ml/gcc-patches/2018-07/msg00115.html>.

The problem only happens when using a typedef, because in cp_build_binary_op
we're comparing the types using ==, which I think only works for canonical
types.  So use same_type_p to avoid this problem.

Bootstrapped/regtested on x86_64-linux, ok for trunk?  I think it makes sense
to fix in in 9.3 too.

OK for both.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]