https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97595
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- Reduced: #include <iostream> template void std::basic_iostream<char>::swap(basic_iostream&); The preprocessed code is no smaller, but this should only generate code for the problematic function, not the entire class and all its bases.