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++/105191] [12 Regression] '<expression>' "is not a constant expression" regression in GCC 12
Date: Sat, 09 Apr 2022 03:27:48 +0000	[thread overview]
Message-ID: <bug-105191-4-5R1ewNP3x7@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105191-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:4822108e61ab879067482704f2f7d1670813d61a

commit r12-8066-g4822108e61ab879067482704f2f7d1670813d61a
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Apr 8 15:33:41 2022 -0400

    c++: constexpr non-trivial aggregate init [PR105191]

    My patch for PR92385 made us use VEC_INIT_EXPR for aggregate initialization
    of an array where some elements are not explicitly initialized.  Constexpr
    handling of that was treating initialization from {} as equivalent to
    value-initialization, which is problematic for classes with default member
    initializers that make the default constructor non-trivial; in older
    standard modes, not initializing all members makes a constructor
    non-constexpr, but aggregate initialization is fine.

            PR c++/105191
            PR c++/92385

    gcc/cp/ChangeLog:

            * tree.cc (build_vec_init_elt): Do {}-init for aggregates.
            * constexpr.cc (cxx_eval_vec_init): Only treat {} as value-init
            for non-aggregate types.
            (build_vec_init_expr): Also check constancy of explicit
            initializer elements.

    gcc/testsuite/ChangeLog:

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

  parent reply	other threads:[~2022-04-09  3:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07  3:07 [Bug c++/105191] New: " strager.nds at gmail dot com
2022-04-07 11:58 ` [Bug c++/105191] [12 Regression] " ppalka at gcc dot gnu.org
2022-04-07 12:09 ` jakub at gcc dot gnu.org
2022-04-08 18:53 ` jason at gcc dot gnu.org
2022-04-09  3:27 ` cvs-commit at gcc dot gnu.org [this message]
2022-04-09  3:30 ` jason at gcc dot gnu.org
2022-05-15 16:28 ` cvs-commit at gcc dot gnu.org
2022-05-15 16:29 ` cvs-commit 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-105191-4-5R1ewNP3x7@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).