Use non-throwing is_directory in filesystem::create_directory
commit9f03f4082135bf1672475f281e25368ece79672d
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Mar 2018 01:09:58 +0000 (9 01:09 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Mar 2018 01:09:58 +0000 (9 01:09 +0000)
tree8501e89c1ac01bf8dd5824c58c4140fc0e204e54
parent70211e1598a9a39d4cbbfde47a893ff1154ad59c
Use non-throwing is_directory in filesystem::create_directory

The create_dir helper was calling the throwing form of
filesystem::is_directory instead of passing the error_code argument.
Since std::filesystem::create_directory(const path&, error_code&) is
noexcept, it would call std::terminate if an error occurred in
is_directory.

Passing the error_code also takes care of clearing it in the case where
is_directory returns true.

src/filesystem/ops.cc (create_dir): Pass error_code to is_directory.
src/filesystem/std-ops.cc (create_dir): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@258375 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/src/filesystem/ops.cc
libstdc++-v3/src/filesystem/std-ops.cc