Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v4 11/16] Don't use the single-argument gdb::span constructor
Date: Wed, 18 Nov 2026 22:34:53 -0500	[thread overview]
Message-ID: <f21fd9da-a0da-4d4e-bea1-7f7bf88c4e96@simark.ca> (raw)
In-Reply-To: <20261118-span-part-1-v4-11-5ecf901e570b@adacore.com>

> diff --git a/gdb/unittests/span-selftests.c b/gdb/unittests/span-selftests.c
> index eb192bd49fd..3e3a7f59ace 100644
> --- a/gdb/unittests/span-selftests.c
> +++ b/gdb/unittests/span-selftests.c
> @@ -431,9 +431,9 @@ run_tests ()
>      SELF_CHECK (check_container_view (view, array));
>  
>      gdb_byte elem = 0;
> -    view = elem;
> +    view = gdb::make_span (&elem, 1);
>      SELF_CHECK (check_elem_view (view, elem));
> -    view = std::move (elem);
> +    view = std::move (gdb::make_span (&elem, 1));
>      SELF_CHECK (check_elem_view (view, elem));

Ultimately, these ones are testing assigning a span from a span, which
is extensively tested a few lines below, where it says:

  /* Same, but op=(view).  */

I think you can remove these two tests, since the point is that you're
removing that capability.  They could be removed in patch "Make
gdb::span conform more closely to C++20" since that's the one
introducing the behavior change.

>    }
>  
> @@ -519,7 +519,7 @@ run_tests ()
>      SELF_CHECK (view_array.size () == 3);
>  
>      Vec elem;
> -    gdb::span<Vec> view_elem = elem;
> +    gdb::span<Vec> view_elem = gdb::make_span (&elem, 1);
>      SELF_CHECK (view_elem.size () == 1);

Likewise here.

Otherwise LGTM.

Approved-By: Simon Marchi <simon.marchi@efficios.com>

Simon

  reply	other threads:[~2026-11-19  3:35 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 22:56 [PATCH v4 00/16] Rename gdb::array_view to gdb::span Tom Tromey
2026-11-18 22:56 ` [PATCH v4 01/16] Rename array_view files Tom Tromey
2026-11-18 22:56 ` [PATCH v4 02/16] Rename gdb::array_view to gdb::span Tom Tromey
2026-11-18 22:56 ` [PATCH v4 03/16] Rename gdb::make_array_view to gdb::make_span Tom Tromey
2026-11-18 22:56 ` [PATCH v4 04/16] Rename gdb_argv::as_array_view Tom Tromey
2026-11-18 22:56 ` [PATCH v4 05/16] Remove operator== and operator!= from gdb::span Tom Tromey
2026-11-18 22:56 ` [PATCH v4 06/16] Rename span::slice to span::subspan Tom Tromey
2026-11-18 22:56 ` [PATCH v4 07/16] Qualify calls to gdb::copy Tom Tromey
2026-11-18 22:56 ` [PATCH v4 08/16] Add single-argument overloads of process_options et al Tom Tromey
2026-11-18 22:56 ` [PATCH v4 09/16] Remove span from cli-option.c:build_help_option Tom Tromey
2026-11-18 22:56 ` [PATCH v4 10/16] gdb/unittests: use one static_assert per check in span-selftests.c Tom Tromey
2026-11-18 22:56 ` [PATCH v4 11/16] Don't use the single-argument gdb::span constructor Tom Tromey
2026-11-19  3:34   ` Simon Marchi [this message]
2026-11-19  3:42   ` Simon Marchi
2026-11-18 22:56 ` [PATCH v4 12/16] Don't turn rvalue reference into a span Tom Tromey
2026-11-19  3:50   ` Simon Marchi
2026-11-19 14:56     ` Tom Tromey
2026-11-18 22:56 ` [PATCH v4 13/16] Make gdb::span conform more closely to C++20 Tom Tromey
2026-11-18 22:56 ` [PATCH v4 14/16] Allow the use of C++20 std::ranges in gdbsupport/ranges.h Tom Tromey
2026-11-18 22:56 ` [PATCH v4 15/16] Allow the use of C++20 std::span in gdbsupport/span.h Tom Tromey
2026-11-19  3:52   ` Simon Marchi
2026-11-20 15:52   ` Jan Vrany
2026-11-20 20:15     ` Simon Marchi
2026-11-18 22:56 ` [PATCH v4 16/16] Move gdb::ranges::equal to gdbsupport/ranges.h Tom Tromey
2026-11-19  4:21 ` [PATCH v4 00/16] Rename gdb::array_view to gdb::span Simon Marchi

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=f21fd9da-a0da-4d4e-bea1-7f7bf88c4e96@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@adacore.com \
    /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