This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] 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.

Tested powerpc64le-linux, committed to trunk and will backport to
gcc-8-branch too.


Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]