Re: [C++ PATCH] Fix up constexpr virtual calls (PR c++/92695)

2019-12-02 Thread Jason Merrill
On 12/2/19 4:43 PM, Jakub Jelinek wrote: On Mon, Dec 02, 2019 at 02:29:56PM -0500, Jason Merrill wrote: On 11/27/19 6:38 PM, Jakub Jelinek wrote: + if (i == 0 && DECL_VIRTUAL_P (fun)) + { + tree addr = arg; + STRIP_NOPS (addr); + if (TREE_CO

Re: [C++ PATCH] Fix up constexpr virtual calls (PR c++/92695)

2019-12-02 Thread Jakub Jelinek
On Mon, Dec 02, 2019 at 02:29:56PM -0500, Jason Merrill wrote: > On 11/27/19 6:38 PM, Jakub Jelinek wrote: > > + if (i == 0 && DECL_VIRTUAL_P (fun)) > > + { > > + tree addr = arg; > > + STRIP_NOPS (addr); > > + if (TREE_CODE (addr) == ADDR_EXPR) > > + { >

Re: [C++ PATCH] Fix up constexpr virtual calls (PR c++/92695)

2019-12-02 Thread Jason Merrill
On 11/27/19 6:38 PM, Jakub Jelinek wrote: Hi! The OBJ_TYPE_REF constexpr handling looks through DECL_FIELD_IS_BASE COMPONENT_REFs to find the actual object on which the method is called, but as the following testcase shows, we need to do the similar thing also for the argument passed as this, be

[C++ PATCH] Fix up constexpr virtual calls (PR c++/92695)

2019-11-27 Thread Jakub Jelinek
Hi! The OBJ_TYPE_REF constexpr handling looks through DECL_FIELD_IS_BASE COMPONENT_REFs to find the actual object on which the method is called, but as the following testcase shows, we need to do the similar thing also for the argument passed as this, because cxx_eval_indirect_ref otherwise fails