https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108503
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 54341 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54341&action=edit gcc13-pr108503.patch This hack works around it, by pretending the VAR_DECLs don't have DECL_VALUE_EXPR between the deduction of the type and actually finalizing their DECL_VALUE_EXPR (for !processing_template_decl only where we do the deduction with temporarily incremented processing_template_decl).