This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/86910] std::filesystem::create_directories doesn't set error code or throw while violating postcondition.
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 10 Aug 2018 11:17:48 +0000
- Subject: [Bug libstdc++/86910] std::filesystem::create_directories doesn't set error code or throw while violating postcondition.
- Auto-submitted: auto-generated
- References: <bug-86910-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86910
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Steffen Schuemann from comment #0)
> std::filesystem::create_directories should create all directories that don't
> exists in the given path. It is not an error if some of the directories
> exist. But they must be directories to fulfil the postcondition.
>
> The current implementation doens't signal an error if it didn't create the
> directory because a file existed with the same name, so the given
> postcondition is_directory(p) is violated but no error occurs.
That is the correct behaviour:
https://cplusplus.github.io/LWG/lwg-defects.html#2935
I don't think this is a bug.