[committed] libstdc++: Add code comment documenting LWG 4027 change [PR118083]
Patrick Palka
ppalka@redhat.com
Wed Feb 26 19:52:39 GMT 2025
Tested on x86_64-pc-linxu-gnu, pushed to trunk as obvious.
-- >8 --
PR libstdc++/118083
libstdc++-v3/ChangeLog:
* include/bits/ranges_base.h
(ranges::__access::__possibly_const_range): Mention LWG 4027.
---
libstdc++-v3/include/bits/ranges_base.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libstdc++-v3/include/bits/ranges_base.h b/libstdc++-v3/include/bits/ranges_base.h
index 28fe64a9e9d..516d04afdab 100644
--- a/libstdc++-v3/include/bits/ranges_base.h
+++ b/libstdc++-v3/include/bits/ranges_base.h
@@ -646,6 +646,8 @@ namespace ranges
constexpr auto&
__possibly_const_range(_Range& __r) noexcept
{
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 4027. possibly-const-range should prefer returning const R&
if constexpr (input_range<const _Range>)
return const_cast<const _Range&>(__r);
else
--
2.48.1.431.g5a526e5e18
More information about the Libstdc++
mailing list