]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Implement LWG 2937 for std::filesystem::equivalent [PR118158]
authorJonathan Wakely <jwakely@redhat.com>
Mon, 30 Dec 2024 13:08:41 +0000 (13:08 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 16 Jan 2025 09:41:00 +0000 (09:41 +0000)
commit301a961ffd0567eece55ece42e80a7ba9e855ba0
tree1b59a14bae6c8771314198edbb3ed2bb253ce63b
parent408f5b847b5b4e552274dc7b02ccaf106395936d
libstdc++: Implement LWG 2937 for std::filesystem::equivalent [PR118158]

Do not report an error for (is_other(s1) && is_other(s2)) as the
standard originally said, nor for (is_other(s1) || is_other(s2)) as
libstdc++ was doing. We can compare inode numbers for special files and
so give sensible answers.

libstdc++-v3/ChangeLog:

PR libstdc++/118158
* src/c++17/fs_ops.cc (fs::equivalent): Remove error reporting
for is_other(s1) && is_other(s2) case, as per LWG 2937.
* testsuite/27_io/filesystem/operations/pr118158.cc: New test.
libstdc++-v3/src/c++17/fs_ops.cc
libstdc++-v3/testsuite/27_io/filesystem/operations/pr118158.cc [new file with mode: 0644]