From: Patrick Palka <ppalka@redhat.com>
To: Jason Merrill <jason@redhat.com>
Cc: Patrick Palka <ppalka@redhat.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] c++: simplify build_new_1 when in a template context
Date: Thu, 26 Oct 2023 16:57:08 -0400 (EDT) [thread overview]
Message-ID: <a9b90e75-c860-e4ab-cb62-4b2267107283@idea> (raw)
In-Reply-To: <ec0a3eca-80be-41c1-9fc3-92b2b56622dc@redhat.com>
On Thu, 26 Oct 2023, Jason Merrill wrote:
> On 10/26/23 14:01, Patrick Palka wrote:
> > Since when in a template context we end up just discarding the result
> > of build_new_1, we don't have to bother with much of the code generation
> > it performs. This patch makes the function exit early, returning a dummy
> > non-erroneous result, once we've done pretty much all ahead of time checks
> > that we could have. In passing avoid building up 'outer_nelts_check' in
> > a template context too.
>
> It seems like this stops checking the calls to the constructor and operator
> delete?
Oops, indeed... I missed that the removed processing_template_decl hunk
still checks the constructor via build_special_member_call. Never mind
then, I guess the function doesn't admit any easy simplification after all :(
I'll add a testcase verifying such ahead of time checking of new-exprs.
>
> Jason
>
>
prev parent reply other threads:[~2023-10-26 20:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-26 18:01 Patrick Palka
2023-10-26 20:36 ` Jason Merrill
2023-10-26 20:57 ` Patrick Palka [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=a9b90e75-c860-e4ab-cb62-4b2267107283@idea \
--to=ppalka@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jason@redhat.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).