public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: Richard Biener <rguenther@suse.de>,
	Alexander Monakov <amonakov@ispras.ru>,
	gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] [RFC] RAII auto_mpfr and autp_mpz
Date: Wed, 8 Mar 2023 11:33:47 +0100	[thread overview]
Message-ID: <ZAhki4BhJlykx5uH@tucnak> (raw)
In-Reply-To: <CACb0b4mMnkdxQRVWrci4Sbt_rx3Yk8y7iBPX9KBHwabPa5qaNg@mail.gmail.com>

On Wed, Mar 08, 2023 at 10:13:39AM +0000, Jonathan Wakely wrote:
> On Wed, 8 Mar 2023 at 07:25, Richard Biener wrote:
> >
> > On Wed, 8 Mar 2023, Alexander Monakov wrote:
> >
> > >
> > > On Tue, 7 Mar 2023, Jonathan Wakely wrote:
> > >
> > > > > Shouldn't this use the idiom suggested in ansidecl.h, i.e.
> > > > >
> > > > >   private:
> > > > >     DISABLE_COPY_AND_ASSIGN (auto_mpfr);
> > > >
> > > >
> > > > Why? A macro like that (or a base class like boost::noncopyable) has
> > > > some value in a code base that wants to work for both C++03 and C++11
> > > > (or later). But in GCC we know we have C++11 now, so we can just
> > > > delete members. I don't see what the macro adds.
> > >
> > > Evidently it's possible to forget to delete one of the members, as
> > > showcased in this very thread.
> >
> > Yes.  And I copy&pasted from somewhere I forgot which also forgot it ...
> 
> Looks like gcc/gimple-predicate-analysis.h and gcc/timevar.h each have
> two cases of a deleted copy constructor but no deleted assignment.
> I'll send a patch for those.

So perhaps use the = delete decls and a standardized comment (same wording
for all the auto_* types) above those which says what the above macro says?
Then one can grep that comment etc.

	Jakub


      reply	other threads:[~2023-03-08 10:33 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06 10:11 Richard Biener
2023-03-06 10:44 ` Jonathan Wakely
2023-03-06 11:01   ` Richard Biener
2023-03-06 11:03     ` Jonathan Wakely
2023-03-06 11:10     ` Jakub Jelinek
2023-03-06 11:29       ` Richard Biener
2023-03-07 18:51         ` Bernhard Reutner-Fischer
2023-03-07 19:03           ` Jakub Jelinek
2023-04-02 15:05         ` [PATCH 0/3] Fix mpfr and mpz memory leaks Bernhard Reutner-Fischer
2023-04-02 15:05         ` [PATCH 1/3] go: Fix memory leak in Integer_expression Bernhard Reutner-Fischer
2023-04-02 15:05         ` [PATCH 2/3] rust: Fix memory leak in compile_{integer,float}_literal Bernhard Reutner-Fischer
2023-04-02 15:05         ` [PATCH 3/3] Fortran: Fix mpz and mpfr memory leaks Bernhard Reutner-Fischer
2023-04-03 19:50           ` Harald Anlauf
2023-04-03 19:50             ` Harald Anlauf
2023-04-03 21:42             ` Bernhard Reutner-Fischer
2023-04-17 19:47               ` ping " Bernhard Reutner-Fischer
2023-04-17 22:18                 ` Steve Kargl
2023-05-08  6:00                   ` Bernhard Reutner-Fischer
2023-03-07 19:15     ` [PATCH] [RFC] RAII auto_mpfr and autp_mpz Alexander Monakov
2023-03-07 21:35       ` Jonathan Wakely
2023-03-07 21:51         ` Alexander Monakov
2023-03-07 21:54           ` Jonathan Wakely
2023-03-07 21:59             ` Marek Polacek
2023-03-08  7:25           ` Richard Biener
2023-03-08 10:13             ` Jonathan Wakely
2023-03-08 10:33               ` Jakub Jelinek [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=ZAhki4BhJlykx5uH@tucnak \
    --to=jakub@redhat.com \
    --cc=amonakov@ispras.ru \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely@redhat.com \
    --cc=rguenther@suse.de \
    /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).