[gcc(refs/users/ppalka/heads/libstdcxx-constrained-algos)] Force the return type of the lambda returned by __make_{comp, pred}_proj to bool

Patrick Palka ppalka@gcc.gnu.org
Tue Jan 28 19:12:00 GMT 2020


https://gcc.gnu.org/g:06a01835c6bacfacc225321a5de4a891784597b7

commit 06a01835c6bacfacc225321a5de4a891784597b7
Author: Patrick Palka <ppalka@redhat.com>
Date:   Tue Jan 28 14:08:53 2020 -0500

    Force the return type of the lambda returned by __make_{comp,pred}_proj to bool

Diff:
---
 libstdc++-v3/include/bits/ranges_algo.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/include/bits/ranges_algo.h b/libstdc++-v3/include/bits/ranges_algo.h
index 1e05bc3..9fb581a 100644
--- a/libstdc++-v3/include/bits/ranges_algo.h
+++ b/libstdc++-v3/include/bits/ranges_algo.h
@@ -75,7 +75,7 @@ namespace ranges
     constexpr auto
     __make_comp_proj(_Comp& __comp, _Proj& __proj)
     {
-      return [&] (auto&& __lhs, auto&& __rhs) -> decltype(auto) {
+      return [&] (auto&& __lhs, auto&& __rhs) -> bool {
 	using _TL = decltype(__lhs);
 	using _TR = decltype(__rhs);
 	return std::__invoke(__comp,
@@ -88,7 +88,7 @@ namespace ranges
     constexpr auto
     __make_pred_proj(_Pred& __pred, _Proj& __proj)
     {
-      return [&] <typename _Tp> (_Tp&& __arg) -> decltype(auto) {
+      return [&] <typename _Tp> (_Tp&& __arg) -> bool {
 	return std::__invoke(__pred,
 			     std::__invoke(__proj, std::forward<_Tp>(__arg)));
       };



More information about the Libstdc++-cvs mailing list