https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104924
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- C++ modules in GCC 11 (and it looks like 12 but some bugs have been fixed there) is still considered experimental and your mileage on this feature will varry. Note I have not checked to see if this has been fixed on the trunk for GCC 12.