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 c++/110197] [13/14 Regression] Empty constexpr object constructor erronously claims out of range access
Date: Thu, 27 Jul 2023 13:10:25 +0000	[thread overview]
Message-ID: <bug-110197-4-NqJzFage0K@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110197-4@http.gcc.gnu.org/bugzilla/>

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

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

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

commit r14-2820-ga426b91b27e28985f47d16827a532fbc28c09bd7
Author: Patrick Palka <ppalka@redhat.com>
Date:   Thu Jul 27 09:10:07 2023 -0400

    c++: constexpr empty subobject elision [PR110197]

    Now that init_subob_ctx no longer sets new_ctx.ctor for a subobject of
    empty type, it seems we need to ensure its callers also consistently
    omit entries in the parent ctx->ctor for such subobjects.  We also need
    to allow cxx_eval_array_reference to synthesize an empty subobject even
    if the array CONSTRUCTOR has CONSTRUCTOR_NO_CLEARING set.

            PR c++/110197

    gcc/cp/ChangeLog:

            * constexpr.cc (cxx_eval_array_reference): Allow synthesizing an
            empty subobject even if CONSTRUCTOR_NO_CLEARING is set.
            (cxx_eval_bare_aggregate): Set 'no_slot' to true more generally
            whenever new_ctx.ctor is set to NULL_TREE by init_subob_ctx,
            i.e. whenever initializing an subobject of empty type.
            (cxx_eval_vec_init_1): Define 'no_slot' as above and use it
            accordingly.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp0x/constexpr-empty18.C: New test.
            * g++.dg/cpp0x/constexpr-empty19.C: New test.

  parent reply	other threads:[~2023-07-27 13:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-09 18:29 [Bug c++/110197] New: " matt at godbolt dot org
2023-06-09 18:37 ` [Bug c++/110197] [13/14 Regression] " mpolacek at gcc dot gnu.org
2023-06-09 18:40 ` mpolacek at gcc dot gnu.org
2023-07-18 18:15 ` mpolacek at gcc dot gnu.org
2023-07-19 15:14 ` ppalka at gcc dot gnu.org
2023-07-20 16:51 ` ppalka at gcc dot gnu.org
2023-07-27  9:26 ` rguenth at gcc dot gnu.org
2023-07-27 13:10 ` cvs-commit at gcc dot gnu.org [this message]
2023-07-27 13:11 ` [Bug c++/110197] [13 " ppalka at gcc dot gnu.org
2023-07-27 13:27 ` matt at godbolt dot org
2023-08-07 23:27 ` cvs-commit at gcc dot gnu.org
2023-08-21 14:04 ` ppalka at gcc dot gnu.org
2023-08-21 14:09 ` matt at godbolt 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-110197-4-NqJzFage0K@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).