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++/101194] [9/10/11/12 Regression] aggregate init requires default constructor Date: Tue, 13 Jul 2021 14:03:33 +0000 [thread overview] Message-ID: <bug-101194-4-NhlrNHzVId@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-101194-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101194 --- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>: https://gcc.gnu.org/g:1b57a9fb90552e52f2a121e2ae12534484b39859 commit r11-8731-g1b57a9fb90552e52f2a121e2ae12534484b39859 Author: Patrick Palka <ppalka@redhat.com> Date: Wed Jun 30 20:44:52 2021 -0400 c++: cxx_eval_array_reference and empty elem type [PR101194] Here the initializer for x is represented as an empty CONSTRUCTOR due to its empty element type. So during constexpr evaluation of the ARRAY_REF x[0], we end up trying to value initialize the omitted element at index 0, which fails because the element type is not default constructible. This patch makes cxx_eval_array_reference specifically handle the case where the element type is an empty type. PR c++/101194 gcc/cp/ChangeLog: * constexpr.c (cxx_eval_array_reference): When the element type is an empty type and the corresponding element is omitted, just return an empty CONSTRUCTOR instead of attempting value initialization. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/constexpr-empty16.C: New test. (cherry picked from commit a688c284dd3848b6c4ea553035f0f9769fb4fbc9)
next prev parent reply other threads:[~2021-07-13 14:03 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-06-24 13:43 [Bug c++/101194] New: 7.2 Regression yannick.lepennec+gcc at live dot fr 2021-06-25 6:14 ` [Bug libstdc++/101194] [9/10/11/12 Regression] rguenth at gcc dot gnu.org 2021-06-25 6:50 ` [Bug c++/101194] [9/10/11/12 Regression] aggregate init requires default constructor marxin at gcc dot gnu.org 2021-06-25 6:50 ` marxin at gcc dot gnu.org 2021-06-25 20:17 ` ppalka at gcc dot gnu.org 2021-06-28 20:21 ` ppalka at gcc dot gnu.org 2021-07-01 0:45 ` cvs-commit at gcc dot gnu.org 2021-07-13 14:03 ` cvs-commit at gcc dot gnu.org [this message] 2021-07-13 14:07 ` [Bug c++/101194] [9/10 " ppalka at gcc dot gnu.org 2022-05-11 17:25 ` cvs-commit at gcc dot gnu.org 2022-05-27 9:05 ` [Bug c++/101194] [9 " rguenth 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-101194-4-NhlrNHzVId@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: linkBe 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).