From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QZK+LVXR/Go0qBkAWB0awg (envelope-from ) for ; Tue, 17 Nov 2026 17:12:37 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=fo6h4i/g; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id B735B1E091; Tue, 17 Nov 2026 17:12:37 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.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 autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::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 38BD81E023 for ; Tue, 17 Nov 2026 17:12:37 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D2A544BA2E1A for ; Tue, 17 Nov 2026 22:12:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D2A544BA2E1A Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=fo6h4i/g Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id 0F1B14BA2E08 for ; Tue, 17 Nov 2026 22:10:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0F1B14BA2E08 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0F1B14BA2E08 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::32e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794953412; cv=none; b=n4BVXf8+Q0L72EISPliRL08lyLjJBZtMO0iAx2Byalugy6cb5cHVNEHprUXy11oyKRNP4bfocHxDWVstv1Bv2QmqIuRQACFp6dtk7ABSmeJpj+YgdcR5uYxC/QUJdlqSrLv2SIORSp6Lqb8xCr2BMvxRBFdIpbLn8/7vhl4iuQY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794953412; c=relaxed/simple; bh=ewfqIqQhtP0ZiChoYcJKtpOFnh2x5BE8RorC7peUSiw=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=u5p3PAaXbdh39+uYdVdjralj2InhTEk9UoOjH6/eyf17XZOStsXMeGhh/VL7bycR4lhndFyMTI7wAwvkD71VzuBexzue1oZq3T2o3RPDBNpjyXgCdheya1d4Pfd2gHmEXdVcdDEwMT3iVEegrEC9YBEf3ZJooE1ZS2VJygnDYhY= ARC-Authentication-Results: i=1; sourceware.org Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-862df509ccbso148391a34.2 for ; Tue, 17 Nov 2026 14:10:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1794953411; x=1795558211; darn=sourceware.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=088wf/bSzojws7t+9/gMuzajSIQRhnu1i9xfcU8Xab4=; b=fo6h4i/g8Z/KRWcUDubAfpBHQxpZAwWqE8bHzOlF716+vYZPhb/xw+MiUCzEBgJTzv ROqJqDcj2zDY01raNIgqxM511DMXhM9lXJN8N83OBZ5oGQ0X8o02crBnnUBh6eFHj6BZ xN1kYV5dZNDI1xun5d75Wl6YVRfryOdZ/KxZc7798rwubPBIjIkVJl151BvSdYd2e26M RF23VzRd094YE4zM7hLJ32Cl/XXmUcPVR6ItNAtNQDSTGC0kl0tanlAlOYte7xsIjBks 6B898gMNrEEtAl2QgRv2LRcfsT9Nst6q3baydB4I1p4k3WKX8oBQXzK0Pv09Py2S4fVm +sRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794953411; x=1795558211; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=088wf/bSzojws7t+9/gMuzajSIQRhnu1i9xfcU8Xab4=; b=Bsr/rhyb1coaWQazBqtVBsFCAXS/yJILUFTW5gRWIjo2l88YnFFEBDMI65PYGjKxCF /i4tfy8Vhec4zdimbYqRNemgLyPBB7G7HowTPCxeWVD+ND7opN/Lm7VVObg2E0ccpY6/ aYzuAoKDydMGLTYfEm233seIu+g0A+BBSBIypJFsX7ptf6sNRzZMUsV/4UlGfSDpO/IF qbO7zKlOJ6Nh7ohvlB92Un9TRlh6jTGhsMJW9ZpWipZfpVuFoEVfu6BhIVgzE+cgvFES YxwgEPTTlK5RMqmUbMIIAQ+dYnEKNQNOLqhUknK4ALtX4n6iQHfIXvxoeHwHuwyESd85 eyUQ== X-Gm-Message-State: APuU4Z8mVr3aZnSDNpD7NG/ymd7Af7vrmKGJrNCXPLOTWvlTTA/Ew8C5 /L1NYevMAKVO1SQqa1evOC4qCHqBctnBwZicQYomIo7dkogy3mf7R8D3EZVixnsf6A== X-Gm-Gg: AYBFou2aJ4D2p1ayvuF9bHGgbJZaIERhsbUnSqpUZWNOD7YkW+bgdxO4I3EKfwNpOrA oswYgiW2GQZmSsbVUi4ckAS7ljwuXUt6mNeez+AhRc6ggSj4CPlS1UPa5xChBzXngn/z5e4lMuo deSRIvHQXnCjJqztMlpUpZiVbaG4fL0fvbTs5djL5XO1JbOiAvwoL1ZyEQkk3Dx2ANuF8/Tc2AK G16CBI3KEqJzCKVssseszNg8D2XzYruAqZlwP/qHU9esWuGt3lDYkCyE+5aBwz6tv9WwCsJ1ZZL EcZmnmpzJj9PlOsszDf2bFVUsIfYcq419BsY++oeCysMB1ulDNfYe2iOiPAl0fwrk0D0CDob/eP guw6skdUpz2RyruNs5wbyja8QWMBrwYNadFgHUk3vdw4+aueBD40zRNZPeb6gOmrW/XGk3yUpO+ Qh7/fYQ6zOwojhluKrSfUt0zMOGN5Zxyg/iw5TQqKxmtizJeoulDS40Kh9CnEpeueWSNGtIwRQa f/cwV346JD4AdB+WOb/ZyKfCytKQinYgwvgor8WCFjQ+ypWwZs4xhezYSX83O0lVcNFNOBGgVPa 8U2b748LahCtd6D7JfAaM0OPAJ4UECpciS52Xkpb3RFUnQkX6IM6y9JCSC5+Zq1y4u7D5YHRZFE W0K2mOnE= X-Received: by 2002:a05:6830:3d8f:b0:80c:d30f:97d with SMTP id 46e09a7af769-862f0959ae0mr674742a34.30.1794953410845; Tue, 17 Nov 2026 14:10:10 -0800 (PST) Received: from [192.168.0.26] (97-122-110-129.hlrn.qwest.net. [97.122.110.129]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-862f01d4764sm545498a34.5.2026.11.17.14.10.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2026 14:10:10 -0800 (PST) From: Tom Tromey Date: Tue, 17 Nov 2026 15:10:07 -0700 Subject: [PATCH v3 11/17] Don't turn rvalue reference into a span MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261117-span-part-1-v3-11-40b8b11d2d8c@adacore.com> References: <20261117-span-part-1-v3-0-40b8b11d2d8c@adacore.com> In-Reply-To: <20261117-span-part-1-v3-0-40b8b11d2d8c@adacore.com> To: gdb-patches@sourceware.org Cc: Tom Tromey , Simon Marchi X-Mailer: b4 0.16.0 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 Compiling with C++20's std::span failed here, because implicitly converting an rvalue reference to a std::span isn't possible. While it is probably safe in this particular instance, it seems safer in general to disallow this (and anyway we don't have much choice). This patch introduces a temporary to solve this problem. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31422 Approved-By: Simon Marchi --- gdb/rust-lang.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c index 1df3740d39d..79ef7701cb0 100644 --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c @@ -1536,7 +1536,10 @@ eval_op_rust_array (struct type *expect_type, struct expression *exp, error (_("Array with negative number of elements")); if (noside == EVAL_NORMAL && copies > 0) - return value_array (0, std::vector (copies, elt)); + { + std::vector elements (copies, elt); + return value_array (0, elements); + } else { struct type *arraytype -- 2.56.0