[gcc r14-11696] libstdc++: Add code comment documenting LWG 4027 change [PR118083]

Patrick Palka ppalka@gcc.gnu.org
Tue Apr 29 01:41:35 GMT 2025


https://gcc.gnu.org/g:d03c58584da3c440cc9103d6a69f6c36f16f6e97

commit r14-11696-gd03c58584da3c440cc9103d6a69f6c36f16f6e97
Author: Patrick Palka <ppalka@redhat.com>
Date:   Wed Feb 26 14:51:38 2025 -0500

    libstdc++: Add code comment documenting LWG 4027 change [PR118083]
    
            PR libstdc++/118083
    
    libstdc++-v3/ChangeLog:
    
            * include/bits/ranges_base.h
            (ranges::__access::__possibly_const_range): Mention LWG 4027.
    
    (cherry picked from commit 640697f7c2def415db81c84010ae25be0785d867)

Diff:
---
 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 481d9bb5c5d5..eafd982f48e2 100644
--- a/libstdc++-v3/include/bits/ranges_base.h
+++ b/libstdc++-v3/include/bits/ranges_base.h
@@ -635,6 +635,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


More information about the Libstdc++-cvs mailing list