public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/103904] [defect fix] Please backport P2325R3 to 10 and 11
Date: Fri, 11 Feb 2022 14:04:14 +0000	[thread overview]
Message-ID: <bug-103904-4-jCxfMQD3VT@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103904-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103904

--- Comment #14 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Patrick Palka
<ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:18b7cbb2ac0bf676846d7fe68283f093825357f6

commit r11-9557-g18b7cbb2ac0bf676846d7fe68283f093825357f6
Author: Patrick Palka <ppalka@redhat.com>
Date:   Fri Jul 16 09:44:42 2021 -0400

    libstdc++: invalid default init in _CachedPosition [PR101231]

    The primary template for _CachedPosition is a dummy implementation for
    non-forward ranges, the iterators for which generally can't be cached.
    Because this implementation doesn't actually cache anything, _M_has_value
    is defined to be false and so calls to _M_get (which are always guarded
    by _M_has_value) are unreachable.

    Still, to suppress a "control reaches end of non-void function" warning
    I made _M_get return {}, but after P2325 input iterators are no longer
    necessarily default constructible so this workaround now breaks valid
    programs.

    This patch fixes this by instead using __builtin_unreachable to squelch
    the warning.

            PR libstdc++/103904
            PR libstdc++/101231

    libstdc++-v3/ChangeLog:

            * include/std/ranges (_CachedPosition::_M_get): For non-forward
            ranges, just call __builtin_unreachable.
            * testsuite/std/ranges/istream_view.cc (test05): New test.

    (cherry picked from commit 1af937eb6246ad7f63ebff03590e9eede33aca81)

  parent reply	other threads:[~2022-02-11 14:04 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-04 15:22 [Bug c++/103904] New: " h2+bugs at fsfe dot org
2022-01-04 15:45 ` [Bug libstdc++/103904] " redi at gcc dot gnu.org
2022-01-04 15:46 ` redi at gcc dot gnu.org
2022-01-04 15:51 ` redi at gcc dot gnu.org
2022-01-04 15:55 ` h2+bugs at fsfe dot org
2022-01-04 16:13 ` redi at gcc dot gnu.org
2022-01-04 17:13 ` h2+bugs at fsfe dot org
2022-01-05  8:42 ` rguenth at gcc dot gnu.org
2022-02-08 15:53 ` h2+bugs at fsfe dot org
2022-02-08 16:30 ` redi at gcc dot gnu.org
2022-02-08 16:54 ` redi at gcc dot gnu.org
2022-02-08 20:58 ` h2+bugs at fsfe dot org
2022-02-11 14:04 ` cvs-commit at gcc dot gnu.org
2022-02-11 14:04 ` cvs-commit at gcc dot gnu.org
2022-02-11 14:04 ` cvs-commit at gcc dot gnu.org [this message]
2022-02-11 20:40 ` cvs-commit at gcc dot gnu.org
2022-05-31 18:39 ` cvs-commit at gcc dot gnu.org
2022-05-31 18:39 ` cvs-commit at gcc dot gnu.org
2022-05-31 18:49 ` ppalka at gcc dot gnu.org
2022-05-31 19:50 ` h2+bugs at fsfe dot 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-103904-4-jCxfMQD3VT@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: link
Be 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).