https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107079
--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> --- The cxx_constant_init call actually takes decl=x so we should probably use that. value = cxx_constant_init (value, decl); However, in cxx_eval_outermost_constant_expr type is const struct X & and so we don't set up ctx.object.