libstdc++-v3/ChangeLog:
PR libstdc++/97167
* src/c++17/fs_path.cc (path::_Parser::root_path()): Check
for empty string before inspecting the first character.
* testsuite/27_io/filesystem/path/append/source.cc: Append
empty string_view to path.
const size_t len = input.size();
// look for root name or root directory
- if (is_dir_sep(input[0]))
+ if (len && is_dir_sep(input[0]))
{
#if SLASHSLASH_IS_ROOTNAME
// look for root name, such as "//foo"
test(p2, s.c_str());
}
+void
+test07()
+{
+ path p, p0;
+ std::string_view s;
+ p /= s; // PR libstdc++/97167
+ compare_paths(p, p0);
+}
+
int
main()
{
test04();
test05();
test06();
+ test07();
}