https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122185 --- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- It is related to r15-2756-g180625ae72b3f7 but the folding of std::foward didn't happen until sometime in GCC 16.