]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Tweak common_iterator::operator-> return type [PR104443]
authorJonathan Wakely <jwakely@redhat.com>
Thu, 28 Jul 2022 19:55:51 +0000 (20:55 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 29 Jul 2022 09:10:00 +0000 (10:10 +0100)
This adjusts the return type to match the resolution of LWG 3672. There
is no functional difference, because decltype(auto) always deduced a
value anyway, but this makes it simpler and consistent with the working
draft.

libstdc++-v3/ChangeLog:

PR libstdc++/104443
* include/bits/stl_iterator.h (common_iterator::operator->):
Change return type to just auto.

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

index 9cd262cd1d92e3d35140057a8dcbbb50c798053e..003cebbec8324e773a7f2b6dc69ca186f3e42646 100644 (file)
@@ -2058,7 +2058,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
     [[nodiscard]]
-    constexpr decltype(auto)
+    constexpr auto
     operator->() const requires __detail::__common_iter_has_arrow<_It>
     {
       __glibcxx_assert(_M_index == 0);