This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/86597] New: directory_entry::exist et al forget to clear the error_code.
- From: "eric at efcs dot ca" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 20 Jul 2018 01:09:46 +0000
- Subject: [Bug libstdc++/86597] New: directory_entry::exist et al forget to clear the error_code.
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86597
Bug ID: 86597
Summary: directory_entry::exist et al forget to clear the
error_code.
Product: gcc
Version: 9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: eric at efcs dot ca
Target Milestone: ---
The "file type observers" of directory entry like exists and is_regular_file
don't clear the error code they are given when no errors occurs.
Reproducer:
#include <filesystem>
#include <cassert>
using namespace std::filesystem;
using namespace std;
int main() {
error_code ec = make_error_code(errc::address_in_use);
directory_entry ent("/tmp");
assert(ent.exists(ec));
assert(!ec);
}
https://wandbox.org/permlink/TpQwW1VwBosGaHXZ