c++: Fix ICE with using and virtual function. [PR95719]
authorJason Merrill <jason@redhat.com>
Wed, 24 Jun 2020 01:25:21 +0000 (21:25 -0400)
committerJason Merrill <jason@redhat.com>
Wed, 24 Jun 2020 19:59:20 +0000 (15:59 -0400)
commit7d6baf68fe22b6ef5b1d6fabbef97c0e1b4d7abf
tree676456440a072d575814e75d8b37421aeeb30565
parent0c586913e61021681e3221e8760cd87b24142aea
c++: Fix ICE with using and virtual function. [PR95719]

conversion_path points to the base where we found the using-declaration, not
where the function is actually a member; look up the actual base.  And then
maybe look back to the derived class if the base is primary.

gcc/cp/ChangeLog:

PR c++/95719
* call.c (build_over_call): Look up the overrider in base_binfo.
* class.c (lookup_vfn_in_binfo): Look through BINFO_PRIMARY_P.

gcc/testsuite/ChangeLog:

PR c++/95719
* g++.dg/tree-ssa/final4.C: New test.
gcc/cp/call.c
gcc/cp/class.c
gcc/testsuite/g++.dg/tree-ssa/final4.C [new file with mode: 0644]