r270961 - in /branches/gcc-8-branch/libstdc++-v...

redi@gcc.gnu.org redi@gcc.gnu.org
Tue May 7 15:46:00 GMT 2019


Author: redi
Date: Tue May  7 15:46:09 2019
New Revision: 270961

URL: https://gcc.gnu.org/viewcvs?rev=270961&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.

Backport from mainline
2019-04-05  Jonathan Wakely  <jwakely@redhat.com>

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

Modified:
    branches/gcc-8-branch/libstdc++-v3/ChangeLog
    branches/gcc-8-branch/libstdc++-v3/include/bits/fs_path.h
    branches/gcc-8-branch/libstdc++-v3/testsuite/27_io/filesystem/path/assign/copy.cc



More information about the Libstdc++-cvs mailing list