https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99290
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:43cbff3da5a856d1b18a9ad33b337ab829af73ed commit r10-10833-g43cbff3da5a856d1b18a9ad33b337ab829af73ed Author: Jonathan Wakely <jwak...@redhat.com> Date: Thu Apr 28 13:06:31 2022 +0100 libstdc++: Fix error reporting in filesystem::copy [PR99290] The recursive calls to filesystem::copy should stop if any of them reports an error. libstdc++-v3/ChangeLog: PR libstdc++/99290 * src/c++17/fs_ops.cc (fs::copy): Pass error_code to directory_iterator constructor, and check on each iteration. * src/filesystem/ops.cc (fs::copy): Likewise. * testsuite/27_io/filesystem/operations/copy.cc: Check for errors during recursion. * testsuite/experimental/filesystem/operations/copy.cc: Likewise. (cherry picked from commit 4e117418fb71f508c479e0144500f4da9cc92520)