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++/90254] [8/9/10 Regression] ice on aggregate initialization of unmovable base Date: Wed, 23 Dec 2020 22:11:46 +0000 [thread overview] Message-ID: <bug-90254-4-AamwlWkqd3@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-90254-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90254 --- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Jason Merrill <jason@gcc.gnu.org>: https://gcc.gnu.org/g:97014e4ada448aa8978b3cd14ed95e0e56f375d9 commit r10-9168-g97014e4ada448aa8978b3cd14ed95e0e56f375d9 Author: Jason Merrill <jason@redhat.com> Date: Wed Aug 12 05:45:02 2020 -0400 c++: Copy elision and [[no_unique_address]]. [PR93711] We don't elide a copy from a function returning a class by value into a base because that can overwrite data laid out in the tail padding of the base class; we need to handle [[no_unique_address]] fields the same way, or we ICE when the middle-end wants to create a temporary object of a TYPE_NEEDS_CONSTRUCTING type. This means that we can't always express initialization of a field with INIT_EXPR from a TARGET_EXPR the way we usually do, so I needed to change several places that were assuming that was sufficient. This also fixes 90254, the same problem with C++17 aggregate initialization of a base. gcc/cp/ChangeLog: PR c++/90254 PR c++/93711 * cp-tree.h (unsafe_return_slot_p): Declare. * call.c (is_base_field_ref): Rename to unsafe_return_slot_p. (build_over_call): Check unsafe_return_slot_p. (build_special_member_call): Likewise. * init.c (expand_default_init): Likewise. * typeck2.c (split_nonconstant_init_1): Likewise. gcc/testsuite/ChangeLog: PR c++/90254 PR c++/93711 * g++.dg/cpp1z/aggr-base10.C: New test. * g++.dg/cpp2a/no_unique_address7.C: New test. * g++.dg/cpp2a/no_unique_address7a.C: New test.
next prev parent reply other threads:[~2020-12-23 22:11 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-90254-4@http.gcc.gnu.org/bugzilla/> 2020-04-20 23:34 ` mpolacek at gcc dot gnu.org 2020-04-21 0:03 ` mpolacek at gcc dot gnu.org 2020-04-21 20:34 ` xerofoify at gmail dot com 2020-04-24 14:56 ` mpolacek at gcc dot gnu.org 2020-08-14 16:58 ` [Bug c++/90254] [8/9/10/11 " cvs-commit at gcc dot gnu.org 2020-08-14 17:01 ` [Bug c++/90254] [8/9/10 " jason at gcc dot gnu.org 2020-12-23 22:11 ` cvs-commit at gcc dot gnu.org [this message] 2021-03-29 11:19 ` rguenth at gcc dot gnu.org 2021-05-14 9:51 ` [Bug c++/90254] [9/10 " jakub at gcc dot gnu.org 2021-06-01 8:13 ` rguenth at gcc dot gnu.org 2021-08-14 10:14 ` pinskia at gcc dot gnu.org 2022-05-27 8:31 ` [Bug c++/90254] [9 " rguenth at gcc dot gnu.org 2022-06-09 15:51 ` m.cencora at gmail dot com
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-90254-4-AamwlWkqd3@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).