Re: C++ PATCH to add -Wclass-conversion

2018-09-19 Thread Jason Merrill
On Wed, Sep 19, 2018 at 4:25 PM, Marek Polacek wrote: > On Wed, Sep 19, 2018 at 04:14:25PM -0400, Jason Merrill wrote: >> On Wed, Sep 19, 2018 at 3:44 PM, Marek Polacek wrote: >> > On Wed, Sep 19, 2018 at 09:40:05PM +0200, Florian Weimer wrote: >> >> Marek Polacek writes: >> >> >> >> > +@item -W

Re: C++ PATCH to add -Wclass-conversion

2018-09-19 Thread Marek Polacek
On Wed, Sep 19, 2018 at 04:14:25PM -0400, Jason Merrill wrote: > On Wed, Sep 19, 2018 at 3:44 PM, Marek Polacek wrote: > > On Wed, Sep 19, 2018 at 09:40:05PM +0200, Florian Weimer wrote: > >> Marek Polacek writes: > >> > >> > +@item -Wno-class-conversion @r{(C++ and Objective-C++ only)} > >> > +@

Re: C++ PATCH to add -Wclass-conversion

2018-09-19 Thread Jason Merrill
On Wed, Sep 19, 2018 at 3:44 PM, Marek Polacek wrote: > On Wed, Sep 19, 2018 at 09:40:05PM +0200, Florian Weimer wrote: >> Marek Polacek writes: >> >> > +@item -Wno-class-conversion @r{(C++ and Objective-C++ only)} >> > +@opindex Wno-class-conversion >> > +@opindex Wclass-conversion >> > +Disable

Re: C++ PATCH to add -Wclass-conversion

2018-09-19 Thread Marek Polacek
On Wed, Sep 19, 2018 at 09:40:05PM +0200, Florian Weimer wrote: > Marek Polacek writes: > > > +@item -Wno-class-conversion @r{(C++ and Objective-C++ only)} > > +@opindex Wno-class-conversion > > +@opindex Wclass-conversion > > +Disable the warning about user-defined conversions converting a class

Re: C++ PATCH to add -Wclass-conversion

2018-09-19 Thread Florian Weimer
Marek Polacek writes: > +@item -Wno-class-conversion @r{(C++ and Objective-C++ only)} > +@opindex Wno-class-conversion > +@opindex Wclass-conversion > +Disable the warning about user-defined conversions converting a class to > +the wrong type, such as having a conversion function converting an >

C++ PATCH to add -Wclass-conversion

2018-09-19 Thread Marek Polacek
This patch adds a new warning -Wclass-conversion that is on by default, and warns about conversion functions converting a class to the wrong type. This was under the -Wconversion umbrella, but we should warn about this by default. It also makes the warning print the types in question. Bootstrapp