https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80963
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #1) > To fix this you need to have the visibility default attribute on the class > Archive . And not just on factory.