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++/83626 Don't throw for remove("") and remove_all("")


This fixes filesystem::remove and filesystem::remove_all for the cases
where the file to be removed doesn't exist. The standard says it
should not be an error, but we were reporting errors.

	PR libstdc++/83626
	* src/filesystem/ops.cc (remove(const path&, error_code&))): Remove
	redundant call to ec.clear().
	(remove_all(const path&, error_code&))): Do not return an error for
	non-existent paths.
	* src/filesystem/std-ops.cc: Likewise.
	* testsuite/27_io/filesystem/operations/remove.cc: New test.
	* testsuite/27_io/filesystem/operations/remove_all.cc: Fix expected
	results for non-existent paths.
	* testsuite/experimental/filesystem/operations/remove.cc: New test.
	* testsuite/experimental/filesystem/operations/remove_all.cc: Fix
	expected results for non-existent paths.

Tested powerpc64le-linux, committed to trunk. Backports to follow.


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]