https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109876
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Patrick Palka from comment #5)
> Seems related to PR89144 too -- there we were mishandling defining a
> non-dependent static std::initializer_list member variable, here we're
> subsequently trying to use it.
The issue there is that the initializer_list wasn't static, but here it is, so
the array temporary should be as well. And presumably the problem is that we
aren't representing that lifetime extension in a template. And checking the
initializer gives up on trying to enforce that. But then when we try to
evaluate the template argument we find that we don't have a constant value to
work with, and complain.
Instead, we should probably treat num as value-dependent even though it
actually isn't. Or fix it to be properly evaluated by representing the
lifetime extension somehow.