* 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.
commit 0d24038c0b565dbcd5e7729423398da281245c41 Author: Jonathan Wakely <jwak...@redhat.com> Date: Tue Dec 18 16:47:52 2018 +0000 LWG 3171: restore stream insertion for filesystem::directory_entry * include/bits/fs_dir.h (operator<<): Overload for directory_entry, as per LWG 3171. * testsuite/27_io/filesystem/directory_entry/lwg3171.cc: New test. diff --git a/libstdc++-v3/include/bits/fs_dir.h b/libstdc++-v3/include/bits/fs_dir.h index 2f81a1709e4..90bdf7305f8 100644 --- a/libstdc++-v3/include/bits/fs_dir.h +++ b/libstdc++-v3/include/bits/fs_dir.h @@ -300,6 +300,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 friend class directory_iterator; friend class recursive_directory_iterator; + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 3171. LWG 2989 breaks directory_entry stream insertion + template<typename _CharT, typename _Traits> + friend basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __os, + const directory_entry& __d) + { return __os << __d.path(); } + directory_entry(const filesystem::path& __p, file_type __t) : _M_path(__p), _M_type(__t) { }