]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Fix error reporting in filesystem::copy [PR99290]
authorJonathan Wakely <jwakely@redhat.com>
Thu, 28 Apr 2022 12:06:31 +0000 (13:06 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 28 Apr 2022 12:33:48 +0000 (13:33 +0100)
commit4e117418fb71f508c479e0144500f4da9cc92520
treecf1ec94b493c3c0c63e162d6840f38efd65ea04a
parentd91cb2059fb8b5a50a2aced199e987ab2cf3b629
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.
libstdc++-v3/src/c++17/fs_ops.cc
libstdc++-v3/src/filesystem/ops.cc
libstdc++-v3/testsuite/27_io/filesystem/operations/copy.cc
libstdc++-v3/testsuite/experimental/filesystem/operations/copy.cc