PR libstdc++/84159 fix appending strings to paths
commite4e906964702358428854a88d9f22245021ec49e
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 May 2018 12:07:09 +0000 (15 12:07 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 May 2018 12:07:09 +0000 (15 12:07 +0000)
tree7d4b3f2e2b2fc7b7fb1c963aa9aabb5b8659f94a
parent581da9d39d0cb47d4e11c9a50a5159fcd7633dce
PR libstdc++/84159 fix appending strings to paths

The path::operator/=(const Source&) and path::append overloads were
still following the semantics of the Filesystem TS not C++17. Only
the path::operator/=(const path&) overload was correct.

This change adds more tests for path::operator/=(const path&) and adds
new tests to verify that the other append operations have equivalent
behaviour.

PR libstdc++/84159
* include/bits/fs_path.h (path::operator/=, path::append): Construct
temporary path before calling _M_append.
(path::_M_append): Change parameter to path and implement C++17
semantics.
* testsuite/27_io/filesystem/path/append/path.cc: Add helper function
and more examples from the standard.
* testsuite/27_io/filesystem/path/append/source.cc: New.
* testsuite/27_io/filesystem/path/decompose/filename.cc: Add comment.
* testsuite/27_io/filesystem/path/nonmember/append.cc: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@260255 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/fs_path.h
libstdc++-v3/testsuite/27_io/filesystem/path/append/path.cc
libstdc++-v3/testsuite/27_io/filesystem/path/append/source.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/path/decompose/filename.cc
libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/append.cc [copied from libstdc++-v3/testsuite/27_io/filesystem/path/append/path.cc with 53% similarity]