public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: Pedro Alves <pedro@palves.net>, Jonathan Wakely <jwakely.gcc@gmail.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 1/2] Add gcc/make-unique.h
Date: Tue, 12 Jul 2022 14:36:53 -0400	[thread overview]
Message-ID: <a846c8fb557944c897d511357493d06722af0387.camel@redhat.com> (raw)
In-Reply-To: <55f00de5-6c6b-51f3-01d4-5f7710e2c792@palves.net>

On Tue, 2022-07-12 at 17:40 +0100, Pedro Alves wrote:
> On 2022-07-12 4:14 p.m., Jonathan Wakely wrote:
> 
> > >  So once GCC requires C++14, why would you want to preserve

I look forward to the happy day when we can use C++14 in GCC's
implementation, but I don't see it happening anytime soon.

GCC's needs may differ from those of GDB's.  I'm not very familiar with
GDB's insides, but, for example, GCC has its own garbage-collector
which complicates everything to do with memory managements.

Right now I have comments expressing ownership of some pointers, and
e.g. "takes ownership of ...".  It would be wonderful to take some baby
steps into using C++11 to express the ownership directly in code.

> > > once-backported symbols in a namespace other than std, when you
> > > no longer have a reason to?
> > > It will just be another unnecessary thing that newcomers at that
> > > future time will have
> > > to learn.
> > 
> > I also don't see a problem with importing std::make_unique into
> > namespace gcc for local use alongside other things in namespace
> > gcc. I
> > do consider that idiomatic. It says "the make_unique for gcc code
> > is
> > std::make_unique". It means you only need a 'using namespace gcc;'
> > at
> > the top of a source file and you get access to everything in
> > namespace
> > gcc, even if it is something like std::make_unique that was
> > originally
> > defined in a different namespace.

Jonathan's idea sounds good to me.

> > 
> 
> If that's the approach, then GCC should import std::unique_ptr,
> std::move,
> std::foo, std::bar into the gcc namespace too, no?  Are you really
> going
> to propose that?

Pedro, it feels to me like you're constructing a strawman here. 
Neither me nor Jonathan are proposing that.

I just want to be able to comfortably use std::unique_ptr in GCC in the
places for which it makes sense, and being able to use "make_unique" is
a part of that.

Hope this is constructive
Dave



  parent reply	other threads:[~2022-07-12 18:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAH6eHdSnGwtScODMveYha1S5WiDo6YsexN_pRqe9n4vq-Pmkig@mail.gmail.com>
2022-07-12  0:25 ` David Malcolm
2022-07-12  0:25   ` [PATCH 2/2] analyzer: use std::unique_ptr for pending_diagnostic/note David Malcolm
2022-07-12  6:48   ` [PATCH 1/2] Add gcc/make-unique.h Jonathan Wakely
2022-07-12  8:13     ` Jonathan Wakely
2022-10-26 20:40     ` [PATCH v3] " David Malcolm
2022-11-02 21:45       ` Jason Merrill
2022-07-12 13:23   ` [PATCH 1/2] " Pedro Alves
2022-07-12 13:45     ` Jonathan Wakely
2022-07-12 14:06       ` Pedro Alves
2022-07-12 15:14         ` Jonathan Wakely
2022-07-12 16:40           ` Pedro Alves
2022-07-12 18:22             ` Jonathan Wakely
2022-07-12 18:36               ` Pedro Alves
2022-07-12 18:41                 ` Pedro Alves
2022-07-12 18:58                   ` Jonathan Wakely
2022-07-12 18:59                     ` Jonathan Wakely
2022-07-12 18:50                 ` Jonathan Wakely
2022-07-12 18:56                   ` Pedro Alves
2022-07-12 18:36             ` David Malcolm [this message]
2022-07-12 18:49               ` Pedro Alves
2022-10-21 16:01 David Malcolm
2022-10-25 23:00 ` David Malcolm

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=a846c8fb557944c897d511357493d06722af0387.camel@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely.gcc@gmail.com \
    --cc=pedro@palves.net \
    /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).