c++: DR2303, ambiguous base deduction [PR97453]
authorkamlesh kumar <kamleshbhalui@gmail.com>
Mon, 2 Nov 2020 15:10:21 +0000 (20:40 +0530)
committerJason Merrill <jason@redhat.com>
Tue, 3 Nov 2020 19:36:24 +0000 (14:36 -0500)
commited7f9957bbb5e899099e1ef0e5f6234c453ef7da
treee234f66f71aead87f0e5a3feab0f35759ee690ef
parenta2058f5812bea3673859a68f9bfea61dbce6730f
c++: DR2303, ambiguous base deduction [PR97453]

When there are two possible matches and one is a base of the other, choose
the derived class rather than fail.

gcc/cp/ChangeLog

2020-10-21  Kamlesh Kumar  <kamleshbhalui@gmail.com>
    Jason Merrill  <jason@redhat.com>

PR c++/97453
DR2303
* pt.c (get_template_base): Consider closest base in template
deduction when base of base also matches.

gcc/testsuite/ChangeLog

2020-10-21  Kamlesh Kumar  <kamleshbhalui@gmail.com>

* g++.dg/DRs/dr2303.C: New test.
gcc/cp/pt.c
gcc/testsuite/g++.dg/DRs/dr2303.C [new file with mode: 0644]