On Tue, Sep 25, 2018 at 3:17 AM, Jakub Jelinek <ja...@redhat.com> wrote: > ARRAY_REF is a handled component, so when a virtual call is on an array > element (or some component thereof), the loop to look through handled > components will look through the ARRAY_REFs too and then TREE_TYPE (obj) > might be an ARRAY_TYPE. The code wants to look at the class type instead > though.
Yeah, I think looping through handled components is wrong here; given something like struct A { virtual void f(); }; struct B { A a; } b; int main() { b.a.f(); } Looking through all handled components would give us "b", which has no virtual functions. I think we need to be more specific about what we're expecting here. Jason