binutils-gdb/gdb/unittests
Andrew Burgess 0b72cde372 gdb: add gdb::make_unique function
While GDB is still C++11, lets add a gdb::make_unique template
function that can be used to create std::unique_ptr objects, just like
the C++14 std::make_unique.

If GDB is being compiled with a C++14 compiler then the new
gdb::make_unique function will delegate to the std::make_unique.  I
checked with gcc, and at -O1 and above gdb::make_unique will be
optimised away completely in this case.

If C++14 (or later) becomes our minimum, then it will be easy enough
to go through the code and replace gdb::make_unique with
std::make_unique later on.

I've make use of this function in all the places I think this can
easily be used, though I'm sure I've probably missed some.

Should be no user visible changes after this commit.

Approved-By: Tom Tromey <tom@tromey.com>
2023-08-23 09:50:30 +01:00
..
basic_string_view
optional
array-view-selftests.c
child-path-selftests.c
cli-utils-selftests.c
command-def-selftests.c
common-utils-selftests.c
copy_bitwise-selftests.c
enum-flags-selftests.c
environ-selftests.c
filtered_iterator-selftests.c
format_pieces-selftests.c
frame_info_ptr-selftests.c
function-view-selftests.c
gdb_tilde_expand-selftests.c
gmp-utils-selftests.c
intrusive_list-selftests.c
lookup_name_info-selftests.c
main-thread-selftests.c
memory-map-selftests.c
memrange-selftests.c
mkdir-recursive-selftests.c
observable-selftests.c
offset-type-selftests.c
optional-selftests.c
packed-selftests.c
parallel-for-selftests.c gdb: add gdb::make_unique function 2023-08-23 09:50:30 +01:00
parse-connection-spec-selftests.c
path-join-selftests.c
ptid-selftests.c
rsp-low-selftests.c
scoped_fd-selftests.c
scoped_ignore_signal-selftests.c
scoped_mmap-selftests.c
scoped_restore-selftests.c
search-memory-selftests.c
string_view-selftests.c
style-selftests.c
tracepoint-selftests.c
tui-selftests.c
ui-file-selftests.c
unique_xmalloc_ptr_char.c
unpack-selftests.c
utils-selftests.c
vec-utils-selftests.c
xml-utils-selftests.c