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++/115645] [11/12/13/14/15 Regression] new S[1][1]() requires non-explicit default ctor since r11-3092
Date: Wed, 10 Jul 2024 16:36:17 +0000	[thread overview]
Message-ID: <bug-115645-4-IKfC7ILGdi@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-115645-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:

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

commit r15-1946-gfde96e8205f343e6471a11cc9def967bb5dd5362
Author: Marek Polacek <polacek@redhat.com>
Date:   Tue Jul 2 15:22:39 2024 -0400

    c++: array new with value-initialization [PR115645]

    This extends the r11-5179 fix which doesn't work with multidimensional
    arrays.  In particular,

      struct S {
        explicit S() { }
      };
      auto p = new S[1][1]();

    should not say "converting to S from initializer list would use
    explicit constructor" because there's no {}.  However, since we
    went into the block where we create a {}, we got confused.  We
    should not have gotten there but we did because array_p was true.

    This patch refines the check once more.

            PR c++/115645

    gcc/cp/ChangeLog:

            * init.cc (build_new): Don't do any deduction for arrays with
            bounds if it's value-initialized.

    gcc/testsuite/ChangeLog:

            * g++.dg/expr/anew7.C: New test.

  parent reply	other threads:[~2024-07-10 16:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-25 13:02 [Bug c++/115645] New: " redi at gcc dot gnu.org
2024-06-25 13:06 ` [Bug c++/115645] " redi at gcc dot gnu.org
2024-06-25 13:07 ` redi at gcc dot gnu.org
2024-06-25 14:14 ` rguenth at gcc dot gnu.org
2024-06-25 14:58 ` mpolacek at gcc dot gnu.org
2024-07-10 16:36 ` cvs-commit at gcc dot gnu.org [this message]
2024-07-10 16:38 ` [Bug c++/115645] [11/12/13/14 " mpolacek at gcc dot gnu.org
2024-07-11 22:34 ` redi at gcc dot gnu.org
2024-07-11 22:37 ` mpolacek at gcc dot gnu.org
2024-07-18 10:37 ` rguenth at gcc dot gnu.org
2024-07-19 13:25 ` [Bug c++/115645] [12/13/14 " rguenth at gcc dot gnu.org
2024-07-31 12:50 ` 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-115645-4-IKfC7ILGdi@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).