]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix typos in std::filesystem code
authorJonathan Wakely <jwakely@redhat.com>
Sat, 2 Oct 2021 20:18:19 +0000 (21:18 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Sat, 2 Oct 2021 20:20:05 +0000 (21:20 +0100)
There were a couple of typos in r12-4070 and r12-4071 which don't show
up when building for POSIX targets.

libstdc++-v3/ChangeLog:

* src/c++17/fs_ops.cc (create_directory): Fix typo in enum name.
* src/filesystem/ops-common.h (__last_system_error): Add
explicit cast to avoid narrowing conversion.
(do_space): Fix type in function name.

libstdc++-v3/src/c++17/fs_ops.cc
libstdc++-v3/src/filesystem/ops-common.h

index cb2dc2c617e48b4dbf542a326c5e7d759a7f32db..5b7f7edd1c9b3daafcec67623077ec91e4ac9d61 100644 (file)
@@ -631,7 +631,7 @@ fs::create_directory(const path& p, const path& attributes,
     }
   return create_dir(p, static_cast<perms>(st.st_mode), ec);
 #else
-  ec = std::make_error_code(std::errc::function_function_not_supported);
+  ec = std::make_error_code(std::errc::function_not_supported);
   return false;
 #endif
 }
index 90ebeba7f012d0c04cdc8ac8c27896d4839c25a6..b3147639cd9895fc8a23993ea2b4e360232d24bb 100644 (file)
@@ -63,7 +63,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   __last_system_error() noexcept
   {
 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS
-    return {::GetLastError(), std::system_category()};
+    return {(int)::GetLastError(), std::system_category()};
 #else
     return {errno, std::generic_category()};
 #endif
@@ -597,7 +597,7 @@ _GLIBCXX_BEGIN_NAMESPACE_FILESYSTEM
        ec.clear();
       }
     else
-      ec = std::last_system_error();
+      ec = std::__last_system_error();
 #else
     ec = std::make_error_code(std::errc::function_not_supported);
 #endif