https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108361
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #3) > But the linker errors is a bug in your code really. Because the original code has references to both std::string and std::system_error .