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++/111250] __glibcxx_requires_subscript assertions are not checked during constant evaluation
Date: Thu, 27 Jun 2024 08:42:09 +0000	[thread overview]
Message-ID: <bug-111250-4-vi23lEwkFY@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111250-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:cfc9fa3bdddc1af59b7854937b99516067fd8c63

commit r15-1688-gcfc9fa3bdddc1af59b7854937b99516067fd8c63
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Jun 18 20:57:13 2024 +0100

    libstdc++: Enable more debug assertions during constant evaluation
[PR111250]

    Some of our debug assertions expand to nothing unless
    _GLIBCXX_ASSERTIONS is defined, which means they are not checked during
    constant evaluation. By making them unconditionally expand to a
    __glibcxx_assert expression they will be checked during constant
    evaluation. This allows us to diagnose more instances of undefined
    behaviour at compile-time, such as accessing a vector past-the-end.

    libstdc++-v3/ChangeLog:

            PR libstdc++/111250
            * include/debug/assertions.h (__glibcxx_requires_non_empty_range)
            (__glibcxx_requires_nonempty, __glibcxx_requires_subscript):
            Define to __glibcxx_assert expressions or to debug mode
            __glibcxx_check_xxx expressions.
            * testsuite/23_containers/array/element_access/constexpr_c++17.cc:
            Add checks for out-of-bounds accesses in constant expressions.
            * testsuite/23_containers/vector/element_access/constexpr.cc:
            Likewise.

  parent reply	other threads:[~2024-06-27  8:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-30 23:55 [Bug libstdc++/111250] New: " redi at gcc dot gnu.org
2024-01-17 11:53 ` [Bug libstdc++/111250] " redi at gcc dot gnu.org
2024-01-17 12:01 ` redi at gcc dot gnu.org
2024-02-08 12:33 ` redi at gcc dot gnu.org
2024-06-18 20:11 ` redi at gcc dot gnu.org
2024-06-27  8:42 ` cvs-commit at gcc dot gnu.org [this message]
2024-06-27  9:03 ` 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-111250-4-vi23lEwkFY@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).