From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id C6F63385843F; Tue, 19 Oct 2021 14:01:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C6F63385843F MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-4507] libstdc++: Fix std::stack deduction guide X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 82b2e4f8cf5a01c6724fe3f465a77ee03cfcaae2 X-Git-Newrev: c4ecb11e4f7ea15f636e463248c8b14083bef05d Message-Id: <20211019140152.C6F63385843F@sourceware.org> Date: Tue, 19 Oct 2021 14:01:52 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Oct 2021 14:01:52 -0000 https://gcc.gnu.org/g:c4ecb11e4f7ea15f636e463248c8b14083bef05d commit r12-4507-gc4ecb11e4f7ea15f636e463248c8b14083bef05d Author: Jonathan Wakely Date: Tue Oct 19 11:38:26 2021 +0100 libstdc++: Fix std::stack deduction guide libstdc++-v3/ChangeLog: * include/bits/stl_stack.h (stack(Iterator, Iterator)): Remove non-deducible template parameter from deduction guide. * testsuite/23_containers/stack/deduction.cc: Check new C++23 deduction guides. Diff: --- libstdc++-v3/include/bits/stl_stack.h | 2 +- libstdc++-v3/testsuite/23_containers/stack/deduction.cc | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/bits/stl_stack.h b/libstdc++-v3/include/bits/stl_stack.h index 429743f5514..76b2e242c37 100644 --- a/libstdc++-v3/include/bits/stl_stack.h +++ b/libstdc++-v3/include/bits/stl_stack.h @@ -322,7 +322,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION -> stack; #ifdef __cpp_lib_adaptor_iterator_pair_constructor - template::value_type, typename = _RequireInputIter<_InputIterator>> diff --git a/libstdc++-v3/testsuite/23_containers/stack/deduction.cc b/libstdc++-v3/testsuite/23_containers/stack/deduction.cc index 169a063687b..dea7ba060d9 100644 --- a/libstdc++-v3/testsuite/23_containers/stack/deduction.cc +++ b/libstdc++-v3/testsuite/23_containers/stack/deduction.cc @@ -87,3 +87,17 @@ test02() std::stack s8(std::move(l), l.get_allocator()); check_type>>(s8); } + +#if __cpp_lib_adaptor_iterator_pair_constructor +void +test03() +{ + std::list l; + + std::stack s1(l.begin(), l.end()); + check_type>(s1); + + std::stack s2(l.begin(), l.end(), std::allocator()); + check_type>(s1); +} +#endif