https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108138
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> --- Just for the record, since nobody seems to have said it yet, the slowdown is independent of the -std option. GCC 8 is fast even with -std=gnu++17 (instead of the default gnu++14) and GCC 11 is slow even with -std=gnu++14 (instead of the default -std=gnu++17).