]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Add code comment documenting LWG 4027 change [PR118083]
authorPatrick Palka <ppalka@redhat.com>
Wed, 26 Feb 2025 19:51:38 +0000 (14:51 -0500)
committerPatrick Palka <ppalka@redhat.com>
Tue, 29 Apr 2025 01:37:48 +0000 (21:37 -0400)
PR libstdc++/118083

libstdc++-v3/ChangeLog:

* include/bits/ranges_base.h
(ranges::__access::__possibly_const_range): Mention LWG 4027.

(cherry picked from commit 640697f7c2def415db81c84010ae25be0785d867)

libstdc++-v3/include/bits/ranges_base.h

index 481d9bb5c5d5fd3a20d8bc771c15af38a9743a4d..eafd982f48e28c298d14e29ffcbc14546a8a4ffe 100644 (file)
@@ -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