This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH for crash with incomplete types
>>>>> Mark Mitchell <mark@markmitchell.com> writes:
>>>>> "Jason" == Jason Merrill <jason@cygnus.com> writes:
>>>>> Mark Mitchell <mark@markmitchell.com> writes:
>>> Here's a patch for the crash on the enclosed testcase. Jason,
>>> OK?
Jason> No. I don't want the new overloading code to use the old
Jason> overloading code, such as convert_arguments. The new code
Jason> is much cleaner, and I'd like to keep it that way. Simple
> I don't quite get it. The code in build_over_call and
> convert_arguments was almost line-for-line identical, but the "old
> code" did a check to make sure that the arguments weren't of
> incomplete type, which the "new code" did not. Would you prefer that
> I copy this check into the new code, thereby increasing the
> duplication?
No; actually, it should be caught in resolve_args.
> This code isn't really doing overload resolution, BTW; it's supposed
> to solve the general problem of "I've decided to call this function
> with these arguments. Are there any conversions I should do?"
Yes, but that is handled differently for the new overloading code, which
decides what conversions are done before deciding which function to call.
It doesn't need to handle all the other stuff that convert_arguments does,
and I'd rather not get it mixed up in there.
> I'm not trying to be contentious; I'm all for cleanliness! I'm just
> not seeing how it's cleaner to have the same code duplicated in both
> places. I'd be happy to share the code in a different way, or in a
> different place, as you see fit.
I don't think there's any useful way to share the code that should be
shared. I think we can just make a note in both places that people
changing one should check the other to see if the same change would be
useful.
Jason