This is the mail archive of the
mailing list for the GCC project.
Re: C++ PATCH for c++/87519 - bogus warning with -Wsign-conversion
- From: Jason Merrill <jason at redhat dot com>
- To: Marek Polacek <polacek at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 8 Aug 2019 11:08:56 -0400
- Subject: Re: C++ PATCH for c++/87519 - bogus warning with -Wsign-conversion
- References: <20190808145000.GW28284@redhat.com>
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
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.