This is the mail archive of the gcc-bugs@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]

Re: Noisy when choosing T::operator Type() vs T::op constType() const


>>>>> "Jason" == Jason Merrill <jason@redhat.com> writes:

    Jason> The warning is intended to let people know about what I
    Jason> consider a rather confusing rule:

It is a confusing rule.  I just don't think warning about it
helps. :-)

Basically, there are tons of things about overloading that are
non-intuitive to people.  The hit rate on this warning, in terms of
actually showing up bugs in code, is probably small, in my opinion.
Whereas a warning about, say, using a possibly uninitialized variable
is more likely to actually indicate a real bug.

To me, this particular warning is the kind of thing that goes in a C++
tutorial, not a compiler warning message.  It occurs too often in
normal bug-free code.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

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