From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id nwMzJflsAGsHjyQAWB0awg (envelope-from ) for ; Fri, 20 Nov 2026 10:53:29 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=vrany.io header.i=@vrany.io header.a=rsa-sha256 header.s=protonmail header.b=MM2IZTPe; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 84B9A1E023; Fri, 20 Nov 2026 10:53:29 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 22B3C1E023 for ; Fri, 20 Nov 2026 10:53:27 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AC66242FA05C for ; Fri, 20 Nov 2026 15:53:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AC66242FA05C Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=vrany.io header.i=@vrany.io header.a=rsa-sha256 header.s=protonmail header.b=MM2IZTPe Received: from mail-24422.protonmail.ch (mail-24422.protonmail.ch [109.224.244.22]) by sourceware.org (Postfix) with ESMTPS id 1530742F9B8A for ; Fri, 20 Nov 2026 15:53:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1530742F9B8A Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=vrany.io Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrany.io ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1530742F9B8A Authentication-Results: sourceware.org; arc=none smtp.remote-ip=109.224.244.22 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795189981; cv=none; b=a/Gy3VZs3eh6GmJdhr/aoDZpBHV5jWjvook8jq7DyBfQlACjxUuUDpBNoSoBtkR4sf8hvN3CsvSYyNeA4W79YSlxeqAS+iEnzBAjy8hXuezgI0wkBC+vqpnVfcDh8vYMMakMu3f9Jo6B9f94M4d6FQTMQBtoiMkBzEKssI5cXPQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795189981; c=relaxed/simple; bh=+T4geMjR7kJRgHltVz9Bzi6rAdbcObTGjzA/fFgBfZc=; h=DKIM-Signature:Date:To:From:Subject:Message-ID:MIME-Version; b=iJjsHjcJ9VWsCUb7IWGageqgfy2NPAIfWeF51Kw3zbfD8B5p3aMg1ADRAF0ynGDU+zewIyVIj0TZYyR78ErfR56+h25Y16kaVwwZKT017qEmphzOSYCVEXgYQA3JVcc6FvC4mPwB9Tc4AoT4dPypj9fZz4r2CbZ4JCumhQMewRM= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=vrany.io header.i=@vrany.io header.a=rsa-sha256 header.s=protonmail header.b=MM2IZTPe DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1530742F9B8A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrany.io; s=protonmail; t=1795189973; x=1795449173; bh=eggmxmrIaW5OdzBKXKsAFhszlMKJAqG1zTmebvfje3c=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=MM2IZTPe/slR0pKNdPgGGT92eUOcJcoJQlqjd6FQUfgt9i/Qeu7/TWXXa0/r1kT6c GWGSTFHjGEDLsioljHfYW98rjgyKgrHLg28nDLsoIqVeF3ZpGT+EyOsgUfH6YY+1g3 5ZGmv1owwtLnn873hoh3D1YLyde/V72q5o72WYQIpOdMbcJTBOOPelING7+610mpuT e58HrODBovF0lOGXa5QlJ40ZqRgVBZaSge5VXyew+3XXDDQ3GeQr/fHAjS3O2NpVTa ZEmiG7XQ42HVYDAZ13bY59SiEOybcPqdv7HGhDi7CyBuNfguDY+8DundRuh2j4qEUR ELRBYRyZdwh8A== Date: Fri, 20 Nov 2026 15:52:49 +0000 To: Tom Tromey , gdb-patches@sourceware.org From: Jan Vrany Subject: Re: [PATCH v4 15/16] Allow the use of C++20 std::span in gdbsupport/span.h Message-ID: <7e87cf228454f373b9f1e70816b01db5225bfed8.camel@vrany.io> In-Reply-To: <20261118-span-part-1-v4-15-5ecf901e570b@adacore.com> References: <20261118-span-part-1-v4-0-5ecf901e570b@adacore.com> <20261118-span-part-1-v4-15-5ecf901e570b@adacore.com> Feedback-ID: 40767693:user:proton X-Pm-Message-ID: 3e93b00e470827d1bf27b01c622b7403636c6f82 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On Wed, 2026-11-18 at 15:56 -0700, Tom Tromey wrote: > This patch changes gdbsupport/span.h to check __cplusplus and then to > use std::span in this setup. >=20 > Eventually, when gdb moves to C++20 (PR gdb/32660), this header can be > greatly simplified and we can rewrite "gdb::span" to "std::span". > Note that the header won't be really removable, because there are some > utility functions here that will need to remain. >=20 > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31422 I just noticed that this breaks when compiling with -D_GLIBCXX_DEBUG=3D1 : CXX unittests/span-selftests.o In file included from /usr/include/c++/16/debug/debug.h:90, from /usr/include/c++/16/bits/stl_algobase.h:68, from /usr/include/c++/16/bits/hashtable_policy.h:37, from /usr/include/c++/16/bits/hashtable.h:37, from /usr/include/c++/16/bits/unordered_map.h:33, from /usr/include/c++/16/unordered_map:43, from /usr/include/c++/16/functional:80, from ./../gdbsupport/ptid.h:35, from ./../gdbsupport/common-defs.h:212, from ././defs.h:26, from : /usr/include/c++/16/span: In instantiation of =E2=80=98constexpr std::span<= _Type, _Extent>::span(_It, _End) [with _It =3D const unsigned char*; _End = =3D unsigned char*; _Type =3D const unsigned char; long unsigned int _Exten= t =3D 18446744073709551615]=E2=80=99: unittests/span-selftests.c:332:41: required from here 332 | gdb::span view1 (cp, p); | ^ /usr/include/c++/16/span:196:11: error: no matching function for call to = =E2=80=98__valid_range(const unsigned char*&, unsigned char*&)=E2=80=99 196 | { __glibcxx_requires_valid_range(__first, __last); } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =E2=80=A2 there are 8 candidates In file included from /usr/include/c++/16/debug/stl_iterator.h:32, from /usr/include/c++/16/bits/stl_iterator.h:3133, from /usr/include/c++/16/bits/ranges_base.h:39, from /usr/include/c++/16/bits/ranges_util.h:34, from /usr/include/c++/16/tuple:46, from /usr/include/c++/16/functional:71: =E2=80=A2 candidate 1: =E2=80=98template constexp= r bool __gnu_debug::__valid_range(_InputIterator, _InputIterator)=E2=80= =99 /usr/include/c++/16/debug/helper_functions.h:200:5: 200 | __valid_range(_InputIterator __first, _InputIterator __la= st) | ^~~~~~~~~~~~~ =E2=80=A2 template argument deduction/substitution failed: =E2=80=A2 deduced conflicting types for parameter =E2=80=98_Input= Iterator=E2=80=99 (=E2=80=98const unsigned char*=E2=80=99 and =E2=80=98unsi= gned char*=E2=80=99) /usr/include/c++/16/span:196:11: 196 | { __glibcxx_requires_valid_range(__first, __last)= ; } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =E2=80=A2 candidate 2: =E2=80=98template constexp= r bool __gnu_debug::__valid_range(_InputIterator, _InputIterator, typename = _Distance_traits<_Iterator>::__type&)=E2=80=99 /usr/include/c++/16/debug/helper_functions.h:219:5: 219 | __valid_range(_InputIterator __first, _InputIterator __la= st, | ^~~~~~~~~~~~~ =E2=80=A2 candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/16/debug/unordered_map:53, from /usr/include/c++/16/unordered_map:48: =E2=80=A2 candidate 3: =E2=80=98template constexpr bool __gnu_debug::__valid_range(const _Safe_= iterator<_Iterator, _Sequence, _Category>&, const _Safe_iterator<_Iterator,= _Sequence, _Category>&, typename _Distance_traits<_Iterator>::__type&)= =E2=80=99 /usr/include/c++/16/debug/safe_iterator.h:1119:5: 1119 | __valid_range(const _Safe_iterator<_Iterator, _Sequence, | ^~~~~~~~~~~~~ =E2=80=A2 candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/16/debug/unordered_map:54: =E2=80=A2 candidate 4: =E2=80=98template bool __gnu_debug::__valid_range(const _Safe_local_iterator<_Iterator, _= Sequence>&, const _Safe_local_iterator<_Iterator, _Sequence>&, typename _Di= stance_traits<_Iterator>::__type&)=E2=80=99 /usr/include/c++/16/debug/safe_local_iterator.h:415:5: 415 | __valid_range(const _Safe_local_iterator<_Iterator, _UCon= tainer>& __first, | ^~~~~~~~~~~~~ =E2=80=A2 candidate expects 3 arguments, 2 provided =E2=80=A2 candidate 5: =E2=80=98template constexpr bool __gnu_debug::__valid_range(const _Safe_= iterator<_Iterator, _Sequence, _Category>&, const _Safe_iterator<_Iterator,= _Sequence, _Category>&)=E2=80=99 /usr/include/c++/16/debug/safe_iterator.h:1134:5: 1134 | __valid_range(const _Safe_iterator<_Iterator, _Sequence, | ^~~~~~~~~~~~~ =E2=80=A2 template argument deduction/substitution failed: =E2=80=A2 mismatched types =E2=80=98const __gnu_debug::_Safe_iter= ator<_Iterator, _Sequence, _Category>=E2=80=99 and =E2=80=98const unsigned = char*=E2=80=99 /usr/include/c++/16/span:196:11: 196 | { __glibcxx_requires_valid_range(__first, __last)= ; } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =E2=80=A2 candidate 6: =E2=80=98template bool __gnu_debug::__valid_range(const _Safe_local_iterator<_Iterator, _= Sequence>&, const _Safe_local_iterator<_Iterator, _Sequence>&)=E2=80=99 /usr/include/c++/16/debug/safe_local_iterator.h:422:5: 422 | __valid_range(const _Safe_local_iterator<_Iterator, _UCon= tainer>& __first, | ^~~~~~~~~~~~~ =E2=80=A2 template argument deduction/substitution failed: =E2=80=A2 mismatched types =E2=80=98const __gnu_debug::_Safe_loca= l_iterator<_Iterator, _Sequence>=E2=80=99 and =E2=80=98const unsigned char*= =E2=80=99 /usr/include/c++/16/span:196:11: 196 | { __glibcxx_requires_valid_range(__first, __last)= ; } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =E2=80=A2 candidate 7: =E2=80=98template constexpr boo= l __gnu_debug::__valid_range(const std::reverse_iterator<_IteratorL>&, cons= t std::reverse_iterator<_IteratorL>&, typename _Distance_traits<_Iterator>:= :__type&)=E2=80=99 /usr/include/c++/16/debug/stl_iterator.h:40:5: 40 | __valid_range(const std::reverse_iterator<_Iterator>& __f= irst, | ^~~~~~~~~~~~~ =E2=80=A2 candidate expects 3 arguments, 2 provided =E2=80=A2 candidate 8: =E2=80=98template constexpr boo= l __gnu_debug::__valid_range(const std::move_iterator<_IteratorL>&, const s= td::move_iterator<_IteratorL>&, typename _Distance_traits<_Iterator>::__typ= e&)=E2=80=99 /usr/include/c++/16/debug/stl_iterator.h:104:5: 104 | __valid_range(const std::move_iterator<_Iterator>& __firs= t, | ^~~~~~~~~~~~~ =E2=80=A2 candidate expects 3 arguments, 2 provided compilation terminated due to -fmax-errors=3D1.