2018-11-28 Jonathan Wakely <jwakely@redhat.com>
+ * doc/xml/manual/intro.xml: Document LWG 3096 change.
+ * src/filesystem/std-path.cc (path::lexically_relative(const path&)):
+ Treat a final empty element equivalently to a final dot element.
+ * testsuite/27_io/filesystem/path/generation/relative.cc: Add checks
+ for the examples in the DR.
+
PR libstdc++/83306
* include/bits/fs_path.h (filesystem_error): Move data members into
pimpl class owned by shared_ptr. Remove inline definitions of member
<listitem><para>Change constructors to constrained templates.
</para></listitem></varlistentry>
+ <varlistentry xml:id="manual.bugs.dr3096"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#3096">3096</link>:
+ <emphasis><code>path::lexically_relative</code> is confused by trailing slashes
+ </emphasis>
+ </term>
+ <listitem><para>Implement the fix for trailing slashes.
+ </para></listitem></varlistentry>
+
</variablelist>
</section>
compare_paths( p.lexically_relative(p), "." );
compare_paths( p.lexically_relative("a/../a/b/../b/c/../c/."), "../../b/c" );
compare_paths( p.lexically_relative("../../../"), "" );
+
+ compare_paths( path("a/./.").lexically_relative("a"), "./." );
+}
+
+void
+test03()
+{
+ // LWG 3096
+ compare_paths( path("/dir").lexically_relative("/dir"), "." );
+ compare_paths( path("/dir").lexically_relative("/dir/"), "." );
+ compare_paths( path("/dir").lexically_relative("/dir/."), "." );
+
+ compare_paths( path("/dir/").lexically_relative("/dir"), "." );
+ compare_paths( path("/dir/").lexically_relative("/dir/"), "." );
+ compare_paths( path("/dir/").lexically_relative("/dir/."), "." );
+
+ compare_paths( path("/dir/.").lexically_relative("/dir"), "." );
+ compare_paths( path("/dir/.").lexically_relative("/dir/"), "." );
+ compare_paths( path("/dir/.").lexically_relative("/dir/."), "." );
}
int
{
test01();
test02();
+ test03();
}