https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80290
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> --- Seems we build many functions (instantiate templates?) and then unify them via fn_type_unification? I believe the root cause is somewhere deeply embedded in the C++ FE ... But again, using preprocessed source with GCC 5 libstdc++ with GCC 7 compiles the thing in just 250MB ram... (note this is all with the old ABI classes but quick testing shows new std::string doesn't make a difference here).