https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126680
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Ah, it's because we mark consteval-only vars DECL_EXTERNAL which makes a
difference here:
static void
set_decl_context_in_fn (tree ctx, tree decl)
{
if (TREE_CODE (decl) == FUNCTION_DECL
|| (VAR_P (decl) && DECL_EXTERNAL (decl)))
/* Make sure local externs are marked as such. OMP UDRs really
are nested functions. */
gcc_checking_assert (DECL_LOCAL_DECL_P (decl)
...
}
