Re: [PATCH 1/2] Add gcc/make-unique.h

2022-10-25 Thread David Malcolm via Gcc-patches
On Fri, 2022-10-21 at 12:01 -0400, David Malcolm wrote: > This patch adds gcc/make-unique.h, containing a minimal C++11 > implementation of make_unique (std::make_unique is C++14). > > The followup patch uses this in dozens of places within the analyzer. > > Successfully bootstrapped & regrtested

[PATCH 1/2] Add gcc/make-unique.h

2022-10-21 Thread David Malcolm via Gcc-patches
This patch adds gcc/make-unique.h, containing a minimal C++11 implementation of make_unique (std::make_unique is C++14). The followup patch uses this in dozens of places within the analyzer. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. OK for trunk? gcc/ChangeLog: * ma

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022 at 19:58, Jonathan Wakely wrote: > [OFFLIST] Oops, sorry, reply-all fail. I meant to spare everybody any further musing on this topic. Really leaving the thread now!

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022 at 19:41, Pedro Alves wrote: > > On 2022-07-12 7:36 p.m., Pedro Alves wrote: > > On 2022-07-12 7:22 p.m., Jonathan Wakely wrote: > >> > >> > >> On Tue, 12 Jul 2022, 17:40 Pedro Alves, >> > wrote: > >> > >> On 2022-07-12 4:14 p.m., Jonathan Wakely w

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Pedro Alves
On 2022-07-12 7:50 p.m., Jonathan Wakely wrote: > Yeah, and I don't think optimizing for indentation is the right trade off. > Putting something in a namespace with a three-letter name just so you don't > have to re-indent some statements in a few years seems odd. > > I see no technical difficu

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022, 19:36 Pedro Alves, wrote: > On 2022-07-12 7:22 p.m., Jonathan Wakely wrote: > > > > > > On Tue, 12 Jul 2022, 17:40 Pedro Alves, pe...@palves.net>> wrote: > > > > On 2022-07-12 4:14 p.m., Jonathan Wakely wrote: > > > > >> So once GCC requires C++14, why would you wan

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Pedro Alves
On 2022-07-12 7:36 p.m., David Malcolm wrote: > On Tue, 2022-07-12 at 17:40 +0100, Pedro Alves wrote: >>> >> >> 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? > > Pedr

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Pedro Alves
On 2022-07-12 7:36 p.m., Pedro Alves wrote: > On 2022-07-12 7:22 p.m., Jonathan Wakely wrote: >> >> >> On Tue, 12 Jul 2022, 17:40 Pedro Alves, > > wrote: >> >> On 2022-07-12 4:14 p.m., Jonathan Wakely wrote: >> >> >>  So once GCC requires C++14, why would you want t

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread David Malcolm via Gcc-patches
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. GC

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Pedro Alves
On 2022-07-12 7:22 p.m., Jonathan Wakely wrote: > > > On Tue, 12 Jul 2022, 17:40 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 > >> once-backported symbols in a n

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022, 17:40 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 > >> once-backported symbols in a namespace other than std, when you no > longer have a reason to? > >> It will just be another unnec

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Pedro Alves
On 2022-07-12 4:14 p.m., Jonathan Wakely wrote: >> So once GCC requires C++14, why would you want to preserve >> 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

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022 at 15:06, Pedro Alves wrote: > > On 2022-07-12 2:45 p.m., Jonathan Wakely wrote: > > On Tue, 12 Jul 2022 at 14:24, Pedro Alves wrote: > >> > >> On 2022-07-12 1:25 a.m., David Malcolm via Gcc-patches wrote: > >> > >>> I tried adding it to gcc/system.h, but anything that uses it

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Pedro Alves
On 2022-07-12 2:45 p.m., Jonathan Wakely wrote: > On Tue, 12 Jul 2022 at 14:24, Pedro Alves wrote: >> >> On 2022-07-12 1:25 a.m., David Malcolm via Gcc-patches wrote: >> >>> I tried adding it to gcc/system.h, but anything that uses it needs to >>> have std::unique_ptr declared, which meant forcibly

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022 at 14:24, Pedro Alves wrote: > > On 2022-07-12 1:25 a.m., David Malcolm via Gcc-patches wrote: > > > I tried adding it to gcc/system.h, but anything that uses it needs to > > have std::unique_ptr declared, which meant forcibly including > > from gcc/system.h > > Did you conside

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Pedro Alves
On 2022-07-12 1:25 a.m., David Malcolm via Gcc-patches wrote: > I tried adding it to gcc/system.h, but anything that uses it needs to > have std::unique_ptr declared, which meant forcibly including > from gcc/system.h Did you consider making gcc/system.h include gcc/make-unique.h itself if INCL

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022 at 07:48, Jonathan Wakely wrote: > You also need for the enable_if and is_array traits. With > libstdc++ that gets included by but that's guaranteed for other > library implementations. Sorry, I was replying from my phone and missed a word. That's **not** guaranteed for oth

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-11 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022, 01:25 David Malcolm, wrote: > On Fri, 2022-07-08 at 22:16 +0100, Jonathan Wakely wrote: > > On Fri, 8 Jul 2022 at 21:47, David Malcolm via Gcc > > wrote: > > > > > > std::unique_ptr is C++11, and I'd like to use it in the > > > gcc/analyzer > > > subdirectory, at least. The

[PATCH 1/2] Add gcc/make-unique.h

2022-07-11 Thread David Malcolm via Gcc-patches
On Fri, 2022-07-08 at 22:16 +0100, Jonathan Wakely wrote: > On Fri, 8 Jul 2022 at 21:47, David Malcolm via Gcc > wrote: > > > > std::unique_ptr is C++11, and I'd like to use it in the > > gcc/analyzer > > subdirectory, at least. The following patch eliminates a bunch of > > "takes ownership" com