aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/bits/fs_path.h
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/include/bits/fs_path.h')
-rw-r--r--libstdc++-v3/include/bits/fs_path.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/libstdc++-v3/include/bits/fs_path.h b/libstdc++-v3/include/bits/fs_path.h
index fb85d489fd8..7ae68f623d1 100644
--- a/libstdc++-v3/include/bits/fs_path.h
+++ b/libstdc++-v3/include/bits/fs_path.h
@@ -107,7 +107,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
template<typename _Tp1, typename _Tp2 = void>
using _Path = typename
std::enable_if<__and_<__not_<is_same<remove_cv_t<_Tp1>, path>>,
- __not_<is_void<_Tp1>>,
+ __not_<is_void<remove_pointer_t<_Tp1>>>,
__constructible_from<_Tp1, _Tp2>>::value,
path>::type;
@@ -168,7 +168,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
path(path&& __p) noexcept
: _M_pathname(std::move(__p._M_pathname)), _M_type(__p._M_type)
{
- _M_split_cmpts();
+ if (_M_type == _Type::_Multi)
+ _M_split_cmpts();
__p.clear();
}
@@ -478,7 +479,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
static basic_string<_CharT, _Traits, _Allocator>
_S_str_convert(const string_type&, const _Allocator& __a);
- bool _S_is_dir_sep(value_type __ch)
+ static bool _S_is_dir_sep(value_type __ch)
{
#ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS
return __ch == L'/' || __ch == preferred_separator;
@@ -789,6 +790,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
inline path&
path::operator=(path&& __p) noexcept
{
+ if (&__p == this)
+ return *this;
+
_M_pathname = std::move(__p._M_pathname);
_M_cmpts = std::move(__p._M_cmpts);
_M_type = __p._M_type;