+2019-02-09 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/71044
+ * include/bits/fs_path.h (path::has_root_name)
+ (path::has_root_directory, path::has_root_path)
+ (path::has_relative_path, path::has_parent_path)
+ (path::has_filename, path::has_stem, path::has_extension)
+ (path::is_absolute, path::is_relative, path::_M_find_extension): Add
+ noexcept.
+ * src/c++17/fs_path.cc (path::has_root_name)
+ (path::has_root_directory, path::has_root_path)
+ (path::has_relative_path, path::has_parent_path)
+ (path::has_filename, path::_M_find_extension): Add noexcept.
+
2019-02-06 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/89102 (partial)
// query
[[nodiscard]] bool empty() const noexcept { return _M_pathname.empty(); }
- bool has_root_name() const;
- bool has_root_directory() const;
- bool has_root_path() const;
- bool has_relative_path() const;
- bool has_parent_path() const;
- bool has_filename() const;
- bool has_stem() const;
- bool has_extension() const;
- bool is_absolute() const;
- bool is_relative() const { return !is_absolute(); }
+ bool has_root_name() const noexcept;
+ bool has_root_directory() const noexcept;
+ bool has_root_path() const noexcept;
+ bool has_relative_path() const noexcept;
+ bool has_parent_path() const noexcept;
+ bool has_filename() const noexcept;
+ bool has_stem() const noexcept;
+ bool has_extension() const noexcept;
+ bool is_absolute() const noexcept;
+ bool is_relative() const noexcept { return !is_absolute(); }
// generation
path lexically_normal() const;
void _M_append(basic_string_view<value_type>);
void _M_concat(basic_string_view<value_type>);
- pair<const string_type*, size_t> _M_find_extension() const;
+ pair<const string_type*, size_t> _M_find_extension() const noexcept;
template<typename _CharT>
struct _Cvt;
}
inline bool
- path::has_stem() const
+ path::has_stem() const noexcept
{
auto ext = _M_find_extension();
return ext.first && ext.second != 0;
}
inline bool
- path::has_extension() const
+ path::has_extension() const noexcept
{
auto ext = _M_find_extension();
return ext.first && ext.second != string_type::npos;
}
inline bool
- path::is_absolute() const
+ path::is_absolute() const noexcept
{
#ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS
return has_root_name() && has_root_directory();
}
bool
-path::has_root_name() const
+path::has_root_name() const noexcept
{
if (_M_type() == _Type::_Root_name)
return true;
}
bool
-path::has_root_directory() const
+path::has_root_directory() const noexcept
{
if (_M_type() == _Type::_Root_dir)
return true;
}
bool
-path::has_root_path() const
+path::has_root_path() const noexcept
{
if (_M_type() == _Type::_Root_name || _M_type() == _Type::_Root_dir)
return true;
}
bool
-path::has_relative_path() const
+path::has_relative_path() const noexcept
{
if (_M_type() == _Type::_Filename && !_M_pathname.empty())
return true;
bool
-path::has_parent_path() const
+path::has_parent_path() const noexcept
{
if (!has_relative_path())
return !empty();
}
bool
-path::has_filename() const
+path::has_filename() const noexcept
{
if (empty())
return false;
}
std::pair<const path::string_type*, std::size_t>
-path::_M_find_extension() const
+path::_M_find_extension() const noexcept
{
const string_type* s = nullptr;