This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [C++] deprecate overload resolution extension?
>>>>> "Jason" == Jason Merrill <jason@redhat.com> writes:
Jason> I don't remember the testcase that motivated me to add this
Jason> extension, but it seemed compelling to me at the time.
I don't find the rule itself compelling, although I can imagine
test-cases where it seems like this would pick a more sensible
alternative. In other words, the example might be more compelling
than the rule.
Jason> It would make sense to me to remove the if (!pedantic) and
I guess that's safe, but I don't see the point. :-)
I totally agree with Robert Dewar about the complexity of the overload
rules.
As an aside, I believe that the single biggest mistake the committee
made was not making *lots more* cases ambiguous. Rather than trying
for obscure tie-breaks that ordinary programmers do not understand,
the committee should have made many corner cases ambiguous, thereby
forcing people to explicitly say what conversions they were expecting.
In the end, however, the language is what it is. But why extend it?
In other words, I second Nathan's motion.
However, I think we need some kind of unanimous consent before we
proceed. Another compromise would be to keep the code (which unlike
some other extensions is simple, compartmentalized, well-documented,
and safe), keep the !pedantic condition, but add a pedwarn. That way
pedantic users just get errors (instead of this rule kicking in, which
they likely won't understand) and non-pedantic users get a warning.
Thoughts?
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com