This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR c++/36921 [4.3/4.4 Regression] warning "comparison does not have mathematical meaning" is not correct for overloaded operators that do not return boolean
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Manuel López-Ibáñez <lopezibanez at gmail dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>, Mark Mitchell <mark at codesourcery dot com>
- Date: Sat, 20 Dec 2008 01:14:32 +0100
- Subject: Re: PR c++/36921 [4.3/4.4 Regression] warning "comparison does not have mathematical meaning" is not correct for overloaded operators that do not return boolean
- References: <6c33472e0810250750y33c10265g3195e8613de1b1fc@mail.gmail.com> <20081025162735.GM14706@tyan-ft48-01.lab.bos.redhat.com> <6c33472e0811041414l57b4b98ibb84350dcf60117f@mail.gmail.com> <494C2488.7000002@redhat.com> <20081219231529.GK17496@tyan-ft48-01.lab.bos.redhat.com> <494C2E6C.8090006@redhat.com> <20081219234720.GL17496@tyan-ft48-01.lab.bos.redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Sat, Dec 20, 2008 at 12:47:20AM +0100, Jakub Jelinek wrote:
> On Fri, Dec 19, 2008 at 06:29:48PM -0500, Jason Merrill wrote:
> > Since, as you point out, we aren't actually missing any wanted warnings,
> > I don't mind putting this logic in warn_about_parentheses. But the test
> > should still check the types of the arguments rather than the whole
> > expression.
>
> You're right, that works too. I've so far just checked this testcase,
> will do full bootstrap/regtest soon.
While it works for C++, it doesn't for C, where the type of the comparison
argument is INTEGER_TYPE. I guess using INTEGRAL_TYPE_P instead should work
though.
Jakub