r270171 - in /trunk/libstdc++-v3: ChangeLog inc...

redi@gcc.gnu.org redi@gcc.gnu.org
Fri Apr 5 16:56:00 GMT 2019


Author: redi
Date: Fri Apr  5 16:56:14 2019
New Revision: 270171

URL: https://gcc.gnu.org/viewcvs?rev=270171&root=gcc&view=rev
Log:
Make filesystem::path safe for self assignment

The standard says "If *this and p are the same object, has no effect."
Previously we ended up clearing the path.

	* include/bits/fs_path.h (path::operator=(path&&)): Check for self
	assignment.
	* src/c++17/fs_path.cc (path::operator=(const path&)): Likewise.
	* testsuite/27_io/filesystem/path/assign/copy.cc: Test self
	assignment.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/fs_path.h
    trunk/libstdc++-v3/src/c++17/fs_path.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/path/assign/copy.cc



More information about the Libstdc++-cvs mailing list