On Thu, Jul 02, 2026 at 01:17:12PM -0400, Jason Merrill wrote:
> > + }
> > + *non_constant_p = true;
> > + return NULL_TREE;
>
> Returning null seems surprising, I would expect to return r (i.e.
> error_mark_node).
We are returning NULL_TREE in most of reflect.cc for both *jump_target and
*non_constant_p = true; cases, so that we don't have to bother
differentiating it.
constexpr.cc then takes care of returning the right thing to the rest
of constexpr.cc:
tree e = process_metafunction (ctx, fun, t, non_constant_p, overflow_p,
jump_target);
if (*jump_target)
return NULL_TREE;
if (*non_constant_p)
return t;
Jakub