public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "ppalka at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/100770] Incorrect if constexpr statement in ranges::unique_copy Date: Thu, 03 Jun 2021 16:36:46 +0000 [thread overview] Message-ID: <bug-100770-4-6pTw4aCaK1@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-100770-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100770 --- Comment #2 from Patrick Palka <ppalka at gcc dot gnu.org> --- Fixed on trunk so far by r12-1195: Author: Patrick Palka <ppalka@redhat.com> Date: Thu, 3 Jun 2021 12:30:29 -0400 libstdc++: Avoid hard error in ranges::unique_copy [PR100770] Here, in the constexpr if condition within ranges::unique_copy, when input_iterator<_Out> isn't satisfied we must avoid substituting into iter_value_t<_Out> because the latter isn't necessarily well-formed then. To that end, this patch factors out the condition into a concept and uses it throughout. This patch also makes the definition of our testsuite output_iterator_wrapper more minimal by setting its value_type, pointer and reference member types to void. This means our existing tests for unique_copy already exercise the fix for this bug, so we don't need to add another test. The only other fallout of this testsuite iterator change appears in std/ranges/range.cc, where the use of range_value_t on a test_output_range is now ill-formed. libstdc++-v3/ChangeLog: * include/bits/ranges_algo.h (__detail::__can_reread_output): Factor out this concept from ... (__unique_copy_fn::operator()): ... here. Use the concept throughout. * testsuite/std/ranges/range.cc: Remove now ill-formed use of range_value_t on an output_range. * testsuite/util/testsuite_iterators.h (output_iterator_wrapper): Define value_type, pointer and reference member types to void.
next prev parent reply other threads:[~2021-06-03 16:36 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-05-26 14:49 [Bug libstdc++/100770] New: " hewillk at gmail dot com 2021-05-26 14:59 ` [Bug libstdc++/100770] " redi at gcc dot gnu.org 2021-05-26 15:25 ` ppalka at gcc dot gnu.org 2021-06-03 16:36 ` ppalka at gcc dot gnu.org [this message] 2021-06-10 21:11 ` cvs-commit at gcc dot gnu.org 2021-06-10 21:22 ` cvs-commit at gcc dot gnu.org 2021-06-10 21:23 ` ppalka at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-100770-4-6pTw4aCaK1@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).