2671. Errors in Copy

Section: 30.11.14.3 [fs.op.copy] Status: C++17 Submitter: Jonathan Wakely Opened: 2014-07-28 Last modified: 2017-07-30

Priority: 0

View other active issues in [fs.op.copy].

View all other issues in [fs.op.copy].

View all issues with C++17 status.

Discussion:

30.11.14.3 [fs.op.copy] paragraph 16 says:

Otherwise if !exists(t) & (options & copy_options::copy_symlinks) != copy_options::none, then copy_symlink(from, to, options).

But there is no overload of copy_symlink that takes a copy_options; it should be copy_symlink(from, to).

30.11.14.3 [fs.op.copy] Paragraph 26 says:

as if by for (directory_entry& x : directory_iterator(from))

but the result of dereferencing a directory_iterator is const; it should be:

as if by for (const directory_entry& x : directory_iterator(from))

[Apr 2016 Issue updated to address the C++ Working Paper. Previously addressed File System TS]

Proposed resolution:

Change 30.11.14.3 [fs.op.copy] paragraph 16 as indicated:

Otherwise if !exists(t) & (options & copy_options::copy_symlinks) != copy_options::none , then copy_symlink(from, to, options).

Change 30.11.14.3 [fs.op.copy] paragraph 26 as indicated:

as if by for (const directory_entry& x : directory_iterator(from))