https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118003
--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> --- I think you'll get similar problems when trying to recurse into them with recursive_directory_iterator, because that's what remove_all was doing when it failed.