https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65295
Aldy Hernandez <aldyh at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org --- Comment #3 from Aldy Hernandez <aldyh at gcc dot gnu.org> --- We're failing in cxx_eval_constant_expression() because the retval is not a DECL_BY_REFERENCE: case RESULT_DECL: if (lval) return t; /* We ask for an rvalue for the RESULT_DECL when indirecting through an invisible reference. */ gcc_assert (DECL_BY_REFERENCE (t)); return (*ctx->values->get (t)); Jason, we also ask for an rvalue in the mentioned testcase, while returning a newly constructed object: constexpr arr f() { arr result; return result; } Could we just remove the assert?