public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-9910] libstdc++: Fix linker errors for directory iterator comparisons
@ 2023-10-03 17:07 Jonathan Wakely
0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2023-10-03 17:07 UTC (permalink / raw)
To: gcc-cvs, libstdc++-cvs
https://gcc.gnu.org/g:222a58dc8f390f72e90d09dd9bea31c67e87bcc0
commit r12-9910-g222a58dc8f390f72e90d09dd9bea31c67e87bcc0
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Tue Oct 3 17:41:14 2023 +0100
libstdc++: Fix linker errors for directory iterator comparisons
These new comparison operators for std::default_sentinel_t require some
new symbol exports, which were added with r13-5662-gdb8d6fc572ec31 for
trunk, but that isn't suitable for the gcc-12 branch.
Define them as specified in the standard instead, which doesn't require
any new symbols.
libstdc++-v3/ChangeLog:
* include/bits/fs_dir.h (directory_iterator::operator==):
Define without using a non-exported shared_ptr symbol.
(recursive_directory_iterator::operator==): Likewise.
Diff:
---
libstdc++-v3/include/bits/fs_dir.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libstdc++-v3/include/bits/fs_dir.h b/libstdc++-v3/include/bits/fs_dir.h
index bec2b7674ef..84e8e8984e8 100644
--- a/libstdc++-v3/include/bits/fs_dir.h
+++ b/libstdc++-v3/include/bits/fs_dir.h
@@ -433,7 +433,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 3719. Directory iterators should be usable with default sentinel
bool operator==(default_sentinel_t) const noexcept
- { return !_M_dir; }
+ { return *this == directory_iterator(); }
#endif
#if __cpp_impl_three_way_comparison < 201907L
@@ -541,7 +541,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 3719. Directory iterators should be usable with default sentinel
bool operator==(default_sentinel_t) const noexcept
- { return !_M_dirs; }
+ { return *this == recursive_directory_iterator(); }
#endif
#if __cpp_impl_three_way_comparison < 201907L
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-10-03 17:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-03 17:07 [gcc r12-9910] libstdc++: Fix linker errors for directory iterator comparisons Jonathan Wakely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).