https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105061
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 52701 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52701&action=edit gcc12-pr105061.patch After reading what template-introduction is I think that is the right fix.