On Tue, Sep 25, 2018 at 09:17:54AM +0200, Jakub Jelinek wrote: > Hi! > > 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. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > 2018-09-25 Jakub Jelinek <ja...@redhat.com> > > PR c++/87398 > * constexpr.c (cxx_eval_constant_expression) <case OBJ_TYPE_REF>: Use > strip_array_types before checking TYPE_BINFO. > > * g++.dg/other/pr87398.C: New test. > * g++.dg/cpp2a/constexpr-virtual10.C: New test.
Can't approve but this looks fine to me, thanks! Marek