[PATCH] c++: Implement DR2303 [PR97453]

Jason Merrill jason@redhat.com
Mon Nov 2 16:18:03 GMT 2020


On 11/2/20 10:10 AM, kamlesh kumar wrote:
> addressed jason comments.
> no regression due to this, tested on x86_64 linux.
> 
> On Tue, Oct 27, 2020 at 11:09 PM Jason Merrill <jason@redhat.com> wrote:
>>
>> On 10/22/20 1:31 PM, kamlesh kumar wrote:
>>> Attaching the patch file.
>>>
>>>   >>Instead of building a hash table, would it work to handle ambiguity by
>>>   >>checking whether one of the classes is a base of the other?
>>
>>> Fixing for cases like: struct B: A<int>,A<int,int> may not be cleaner
>>> this way.
>>
>> Why not?  Your patch does extra work even when there's no ambiguity.
>>
>>> On Thu, Oct 22, 2020 at 3:23 AM Jason Merrill <jason@redhat.com
>>> <mailto:jason@redhat.com>> wrote:
>>>   >
>>>   > On 10/21/20 6:32 AM, kamlesh kumar wrote:
>>>   > > gcc/cp/ChangeLog
>>>   > > -----------------------------------
>>>   > >
>>>   > > 2020-10-21  Kamlesh Kumar  <kamleshbhalui@gmail.com
>>> <mailto:kamleshbhalui@gmail.com>>
>>>   > >
>>>   > > PR c++/97453
>>>   > > * pt.c (get_template_base): Implement DR2303,
>>>   > > Consider closest base while template
>>>   > > deduction when base of base also matches.
>>>   > >
>>>   > > gcc/testsuite/ChangeLog
>>>   > > ------------------------------------------
>>>   > >
>>>   > > 2020-10-21  Kamlesh Kumar  <kamleshbhalui@gmail.com
>>> <mailto:kamleshbhalui@gmail.com>>
>>>   > >
>>>   > > * g++.dg/Drs/dr2303.C: New Test
>>>   > >
>>>   > > --------------------------------------------------
>>>   > >
>>>   > > As part of this patch I Implemented fix for below defect report in cwg
>>>   > > https://wg21.cmeerw.net/cwg/issue2303 .
>>>   >
>>>   > Thanks!
>>>   >
>>>   > Please see https://gcc.gnu.org/contribute.html for guidance on email
>>>   > subject lines; for this patch I'd think something like
>>>   >
>>>   > [PATCH] c++: Implement DR2303 [PR97453]
>>>   >
>>>   > Also, your patch was corrupted by word wrap; the easiest way to avoid
>>>   > that is probably to attach the file rather than copy it into the message.
>>>   >
>>>   > > Reg tested on x86_64 and did not found any failure.
>>>   > > Patch summary: Remove base of base from list of bases
>>>   > >
>>>   > > created a hash_set from list of bases and then iterate over each
>>>   > > element of hash_set and find its  list of bases and remove this from
>>>   > > hash_set if present.
>>>   > > and finally, deduction succeeds if in hash_set remains only single
>>>   > > element or it's empty.
>>>   > > otherwise deduction is ambiguous.
>>>   >
>>>   > Instead of building a hash table, would it work to handle ambiguity by
>>>   > checking whether one of the classes is a base of the other?

This is what I had in mind; it seems clearer to me.  Do you see a reason 
this wouldn't work?

Also, I notice that you still don't seem to have a copyright assignment 
on file with the FSF.  I and Jonathan Wakely both asked about it last 
year; has there been any progress on that?  Your patch is too large to 
go in without a copyright assignment, so it's probably simplest to go 
ahead with mine.

Thanks,
Jason
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dr2303.diff
Type: text/x-patch
Size: 2396 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201102/e038a124/attachment.bin>


More information about the Gcc-patches mailing list