Re: [RFC] Using std::unique_ptr and std::make_unique in our code

2022-08-09 Thread James K. Lowden
On Mon, 11 Jul 2022 20:32:07 -0400 David Malcolm via Gcc wrote: > Perhaps, but right now I prefer to spell out std::unique_ptr, since > I'm not as comfortable with C++11 as I might be. Hi David, [off list] You might be interested to know Bjarne Stroustrup observes that during the development of

Re: [RFC] Using std::unique_ptr and std::make_unique in our code

2022-07-12 Thread Pedro Alves
On 2022-07-12 11:45 a.m., Jonathan Wakely wrote: > On Tue, 12 Jul 2022 at 11:22, Florian Weimer via Gcc wrote: >> >> * Pedro Alves: >> >>> For example, for the type above, we'd have: >>> >>> typedef std::unique_ptr pending_diagnostic_up; >>> >>> and then: >>> >>> -

Re: [RFC] Using std::unique_ptr and std::make_unique in our code

2022-07-12 Thread Pedro Alves
On 2022-07-12 11:21 a.m., Florian Weimer wrote: > * Pedro Alves: > >> For example, for the type above, we'd have: >> >> typedef std::unique_ptr pending_diagnostic_up; >> >> and then: >> >> - pending_diagnostic *d, >> + pending_diagnos

Re: [RFC] Using std::unique_ptr and std::make_unique in our code

2022-07-12 Thread Jonathan Wakely via Gcc
On Tue, 12 Jul 2022 at 11:22, Florian Weimer via Gcc wrote: > > * Pedro Alves: > > > For example, for the type above, we'd have: > > > > typedef std::unique_ptr pending_diagnostic_up; > > > > and then: > > > > -pending_diagnostic *d, > > +

Re: [RFC] Using std::unique_ptr and std::make_unique in our code

2022-07-12 Thread Florian Weimer via Gcc
* Pedro Alves: > For example, for the type above, we'd have: > > typedef std::unique_ptr pending_diagnostic_up; > > and then: > > -pending_diagnostic *d, > +pending_diagnostic_up d, > > I would suggest GCC have a similar guideline

Re: [RFC] Using std::unique_ptr and std::make_unique in our code

2022-07-11 Thread David Malcolm via Gcc
On Mon, 2022-07-11 at 11:56 +0100, Pedro Alves wrote: > Hi! > > On 2022-07-08 9:46 p.m., David Malcolm via Gcc wrote: > > -   pending_diagnostic *d, > > +   > > std::unique_ptr d, > > I see that you didn't add any typedef for std::un

Re: [RFC] Using std::unique_ptr and std::make_unique in our code

2022-07-11 Thread Pedro Alves
Hi! On 2022-07-08 9:46 p.m., David Malcolm via Gcc wrote: > - pending_diagnostic *d, > + std::unique_ptr d, I see that you didn't add any typedef for std::unique_ptr in this patch. It will be inevitable that people will start addin

Re: [RFC] Using std::unique_ptr and std::make_unique in our code

2022-07-08 Thread Jonathan Wakely via Gcc
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" comments and manual "delete" invocations in favor > of simply using std::uniqu

Re: [RFC] Using std::unique_ptr and std::make_unique in our code

2022-07-08 Thread Gabriel Ravier via Gcc
On 7/8/22 22:46, 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" comments and manual "delete" invocations in favor of simply using std::unique_ptr. The problem i

[RFC] Using std::unique_ptr and std::make_unique in our code

2022-07-08 Thread David Malcolm via Gcc
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" comments and manual "delete" invocations in favor of simply using std::unique_ptr. The problem is that the patch makes use of std::make_unique,