https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111284

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 57648
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57648&action=edit
gcc14-pr111284.patch

So, I've tried to fix this by constexpr evaluating the arguments passed to
PARM_DECLs with TREE_ADDRESSABLE types in the caller as lvalues rather than
rvaluea and later, if we try to evaluate the PARM_DECL in the callee as lval,
lookup the value and use that, if it is rval constexpr evaluate again as
rvalue.
There is a complication for qualified type, say if the argument is const in the
callee and caller is passing reference to non-const, adjust_temp_type can't
handle that when it isn't a rvalue.

Reply via email to