This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Inappropriate Warning Cannot Be Turned Off
- To: pthomas at suse dot de
- Subject: Re: Inappropriate Warning Cannot Be Turned Off
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Tue, 6 Jun 2000 09:08:01 +0200
- CC: cogen at ll dot mit dot edu, gcc-bugs at gcc dot gnu dot org, cogen at suse dot de, loewis at informatik dot hu-berlin dot de
- References: <200006052005.QAA13828@ll.mit.edu> <20000606014601.F25525@Jeffreys.suse.de>
> I don't know what the ISO C++ standard has to say on this subject and if a
> diagnostic is needed, I'll have to leave that to Martin. But IMO these aren't
> inappropriate, because they point out possibly unwanted behaviour (Martin?).
>
> I'd agree with you though that there should be a switch to inhibit the
> warning (that is, if a diagnostic isn't required).
The code is correct, but the ISO rules are confusing; this comes from
call.c
/* warn about confusing overload resolution for user-defined conversions,
either between a constructor and a conversion op, or between two
conversion ops. */
You'd have to ask Jason for the exact rationale why there is no option
to turn it off. We had *many* bug reports where people claimed that
the compiler did the wrong thing, when in fact there understanding of
C++ was wrong. Without the warning, they even would not have known
that that the compiler did not what they expected. So overall, I'd say
this feature has proven useful. In many cases, it is possible to
adjust the code by adding a third conversion operator.
Regards,
Martin