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++/103022] std::begin on empty std::valarray causes _GLIBCXX_DEBUG assertion
Date: Mon, 01 Nov 2021 20:18:37 +0000	[thread overview]
Message-ID: <bug-103022-4-rAFax066Na@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103022-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:2374dfc907a9eb6ae2940c0d49de37bcf96bd5e5

commit r10-10246-g2374dfc907a9eb6ae2940c0d49de37bcf96bd5e5
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Nov 1 11:06:51 2021 +0000

    libstdc++: Fix range access for empty std::valarray [PR103022]

    The std::begin and std::end overloads for std::valarray are defined in
    terms of std::addressof(v[0]) which is undefined for an empty valarray.

    libstdc++-v3/ChangeLog:

            PR libstdc++/103022
            * include/std/valarray (begin, end): Do not dereference an empty
            valarray. Add noexcept and [[nodiscard]].
            * testsuite/26_numerics/valarray/range_access.cc: Check empty
            valarray. Check iterator properties. Run as well as compiling.
            * testsuite/26_numerics/valarray/range_access2.cc: Likewise.
            * testsuite/26_numerics/valarray/103022.cc: New test.

    (cherry picked from commit 91bac9fed5d082f0b180834110ebc0f46f97599a)

  parent reply	other threads:[~2021-11-01 20:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-01 10:42 [Bug libstdc++/103022] New: " sbergman at redhat dot com
2021-11-01 10:56 ` [Bug libstdc++/103022] " redi at gcc dot gnu.org
2021-11-01 13:26 ` cvs-commit at gcc dot gnu.org
2021-11-01 19:14 ` cvs-commit at gcc dot gnu.org
2021-11-01 20:18 ` cvs-commit at gcc dot gnu.org [this message]
2021-11-01 20:58 ` cvs-commit at gcc dot gnu.org
2021-11-01 20:59 ` redi 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-103022-4-rAFax066Na@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).