From: Jason Merrill <jason@redhat.com>
To: Jakub Jelinek <jakub@redhat.com>, gcc-patches@gcc.gnu.org
Cc: Tobias Burnus <tburnus@baylibre.com>
Subject: Re: [committed] c++: Fix ICE with weird copy assignment operator [PR114572]
Date: Mon, 8 Apr 2024 17:30:39 -0400 [thread overview]
Message-ID: <95a65b47-8154-4586-91bc-6478d5eb55b2@redhat.com> (raw)
In-Reply-To: <Zg+pwRtoLVwoyDsu@tucnak>
On 4/5/24 03:35, Jakub Jelinek wrote:
> Hi!
>
> While ctors/dtors don't return anything (undeclared void or this pointer
> on arm) and copy assignment operators normally return a reference to *this,
> it isn't invalid to return uselessly some class object which might need
> destructing, but the OpenMP clause handling code wasn't expecting that.
>
> The following patch fixes that.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk so
> far.
>
> 2024-04-05 Jakub Jelinek <jakub@redhat.com>
>
> PR c++/114572
> * cp-gimplify.cc (cxx_omp_clause_apply_fn): Call build_cplus_new
> on build_call_a result if it has class type.
>
> * testsuite/libgomp.c++/pr114572.C: New test.
>
> --- gcc/cp/cp-gimplify.cc.jj 2024-04-02 13:07:58.540385210 +0200
> +++ gcc/cp/cp-gimplify.cc 2024-04-04 16:41:50.781008370 +0200
> @@ -2480,6 +2480,8 @@ cxx_omp_clause_apply_fn (tree fn, tree a
> TREE_PURPOSE (parm), fn,
> i - is_method, tf_warning_or_error);
> t = build_call_a (fn, i, argarray);
> + if (MAYBE_CLASS_TYPE_P (TREE_TYPE (t)))
> + t = build_cplus_new (TREE_TYPE (t), t, tf_warning_or_error);
Maybe use build_cxx_call instead of build_call_a?
Jason
prev parent reply other threads:[~2024-04-08 21:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-05 7:35 Jakub Jelinek
2024-04-08 21:30 ` Jason Merrill [this message]
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=95a65b47-8154-4586-91bc-6478d5eb55b2@redhat.com \
--to=jason@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=tburnus@baylibre.com \
/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).