On 20/12/18 04:08 -0500, Tim Song wrote:
On Tue, Dec 18, 2018 at 10:57 AM Jonathan Wakely <jwak...@redhat.com> wrote:
* include/bits/fs_dir.h (operator<<): Overload for directory_entry,
as per LWG 3171.
* testsuite/27_io/filesystem/directory_entry/lwg3171.cc: New test.
Tested x86_64-linux, committed to trunk.
The test seems to be missing from the patch.
Thanks, I forgot to 'git add' it. Fixed by this, committed to trunk.
commit 7274fd7de0a1ea4c8ab12cec8a6a5ae38bcbdea1
Author: Jonathan Wakely <jwak...@redhat.com>
Date: Thu Dec 20 12:13:17 2018 +0000
Add missing test from previous commit
* testsuite/27_io/filesystem/directory_entry/lwg3171.cc: New test
(missed from previous commit).
diff --git a/libstdc++-v3/testsuite/27_io/filesystem/directory_entry/lwg3171.cc b/libstdc++-v3/testsuite/27_io/filesystem/directory_entry/lwg3171.cc
new file mode 100644
index 00000000000..d9adffbac4d
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/filesystem/directory_entry/lwg3171.cc
@@ -0,0 +1,40 @@
+// Copyright (C) 2018 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++17 -lstdc++fs" }
+// { dg-do run { target c++17 } }
+// { dg-require-filesystem-ts "" }
+
+#include <filesystem>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ std::filesystem::directory_entry ent("foo/bar");
+ std::ostringstream os1, os2;
+ os1 << ent;
+ os2 << ent.path();
+ VERIFY( os1.str() == os2.str() );
+}
+
+int
+main()
+{
+ test01();
+}