From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id RJxxIuz/AWtBvCkAWB0awg (envelope-from ) for ; Sat, 21 Nov 2026 15:32:44 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Wsa0vESB; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 79CDC1E023; Sat, 21 Nov 2026 15:32:44 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,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 037501E023 for ; Sat, 21 Nov 2026 15:32:43 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C283643A24B3 for ; Sat, 21 Nov 2026 20:32:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C283643A24B3 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Wsa0vESB Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 1990843A24B3 for ; Sat, 21 Nov 2026 20:32:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1990843A24B3 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1990843A24B3 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795293136; cv=none; b=gKHqWkxx5lCcrEuddtzaOxPI7dxD/9b3A+wMHvm+h4ixKjbO6ZTFfb4r1r8P0mHzeRt3ftSvlJRqM5oAZIWLmTplZ+kb6N7y9A/XhJJIJZl+sElCL/F/BO3j6RoLzfXLaAhW228GIiFIce/Y7AwmzVJHwRbbqFc4aAQlrH2wG5g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795293136; c=relaxed/simple; bh=3pGoVaJg+LHusWvuqdQHLryDZUAU9FEmrNv5CwNe+XI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=diQxD1BWfVF7IztEuXBIvG4uIaafscno96iE/3Lgz7EYIs64bkIkkgfx1FPuaRVtwZ5z9Bc8O/eNR/s2SdQnSJZmoOSQG3m7gVxOZ6eU0kvThaqJ82iOGBgGq0Mz25u6y/JapZZNb+143qNFOsKya/I9DtLllzNgl5IwsdqZ0o4= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Wsa0vESB DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1990843A24B3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795293135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1VrX1svo5O59V+sMwXKOZd5tRH22r1iQZT621quYsrI=; b=Wsa0vESB8DB2+vchKpHzsqSQrUD9ovVbpLzu46nNvSTHZLdbAtJsZmpqf+UCaWXuEGV5Ip iAXP8BV4TrGf2jnmX3xyPtKDbRZbJ+foXl3/y077kGDHHGr0+Y7ST0a3MQzaGsLFyp5ztq YC3zGjOn7tfX0kC8YXtBam6cku6zHFM= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-437-WRUEyP0gPfCnPXZ5U7J2wA-1; Sat, 21 Nov 2026 20:32:12 +0000 X-MC-Unique: WRUEyP0gPfCnPXZ5U7J2wA-1 X-Mimecast-MFC-AGG-ID: WRUEyP0gPfCnPXZ5U7J2wA_1795293132 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-49febef74e3so20992855e9.0 for ; Sat, 21 Nov 2026 12:32:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795293131; x=1795897931; h=content-type:mime-version:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=1VrX1svo5O59V+sMwXKOZd5tRH22r1iQZT621quYsrI=; b=vFc/qSk5SeokDzFhsK420r2OhO2FUhTkuZmnAcfkL/yKf3jm+VvtdFlOgqMVEjMq/B 102kQdZ8F9ivfNo6Uv5b+PpCgmtc39i+mQgAaw7A2PFxxlYXkAjbW5Vk0RNmvwLV9Cgl 4YCqcX3CnqMbUF9xRSDyz6msfEu7uO0Lzu2AXntoEGy1YxQqei1efjjtkc5DffYbsFG9 P7EgCcRQEwdGxjnwcOnWDiWDJHMsTQUGHEFBrUr78uDaUeVksTaWJpiOeSRlBA5Unt2w MKCS7yFFUV0ag5Eq8nmPP9VJf20/H9RTR/bRgot9nb8S+gxXEX2h3DrI8PnXeSuM8+OE c9AQ== X-Forwarded-Encrypted: i=1; AL+hErHnPrHyw8kCOQbekWddjAk9E4mrRNLtMVPXMwHoTAkqYUTP+cDJ6kiE7Hd1GhM4cXMmUsnefwPEU2ZNBg==@sourceware.org X-Gm-Message-State: APuU4Z+93gK9krDm4aFkQVKuN5W23/Uiy7PoCNzsjjk7cpgp8Ul+Nuqy imKaMuSxMfyCOH9Y2Ca5AGojlD0/7CpSPZKCOwM7k4+P3RkNtZxwdumN5wYMSEaC/mCbbWvVqWM SkgVjc0wj/i9yd0aDBtwJ3MfIZRhR1QxAYlgVhlXKWYHbNiErqB1We5UsFJ5xPnqcQX46yLM= X-Gm-Gg: AZFdTZdHkG/LTFE02tOlGQGCsJJCqe49gM8CBoiZ1L2pGGBexP3QNz1KSlDppRG3wHh Y2T8m7ccavs2zSW1aTzD8poGOKx5K/ugwnKvDh+OOm9My0R3hOhaKE1K53CRlacQc4VEi+jBuBq JDkACfEtcxFG1s8N0+eBdOTks5Vj0Ikjif3HYyBGhzb71DkyIfB13M2Nhy9nJzk79Rf1o9k5upW zlACZTF8HlKEvRHvJVtY9Mg4Cd3x5ukaaXoALoV556IZhSov+XfWhgoQXmjQpc62lEow5Gcc9yy 8052trteO/hs4mVblxMYqduWcn4qesi7WHFkG08/LY/jxFqUDNC3sSs96XX3x8IVeNUcCDoouuB +lcvJI/9aEI6EA/qTmgXbUpkDPNIvMcK+z4brA5WsOLtk6gQ= X-Received: by 2002:a05:600c:4f81:b0:4bb:5e8c:13bc with SMTP id 5b1f17b1804b1-4bb88805902mr149312105e9.7.1795293131580; Sat, 21 Nov 2026 12:32:11 -0800 (PST) X-Received: by 2002:a05:600c:4f81:b0:4bb:5e8c:13bc with SMTP id 5b1f17b1804b1-4bb88805902mr149311975e9.7.1795293131132; Sat, 21 Nov 2026 12:32:11 -0800 (PST) Received: from localhost ([83.216.138.189]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb906d6a13sm65809205e9.3.2026.11.21.12.32.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Nov 2026 12:32:10 -0800 (PST) From: Andrew Burgess To: Simon Marchi , gdb-patches@sourceware.org Cc: Simon Marchi Subject: Re: [PATCH 1/2] gdb/unittests: skip mixed constness span tests with libstdc++ debug mode In-Reply-To: <20261120201510.3162938-1-simon.marchi@efficios.com> References: <20261120201510.3162938-1-simon.marchi@efficios.com> Date: Sat, 21 Nov 2026 20:32:08 +0000 Message-ID: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: mBiyV9S-kQFcAsSZ5yhiylWeF4BOmUgYXGikffhs43M_1795293132 X-Mimecast-Originator: redhat.com Content-Type: text/plain 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 Simon Marchi writes: > When building GDB in C++20 mode with -D_GLIBCXX_DEBUG, span-selftests.c > fails to compile with: > > /usr/include/c++/16/span:196:11: error: no matching function for call to '__valid_range(const unsigned char*&, unsigned char*&)' > > In debug mode, the (first, last) constructor of libstdc++'s std::span > validates the range by calling __gnu_debug::__valid_range, which > requires both iterators to have the same type. Constructing a span from > two pointers of different constness is valid C++20, but doesn't compile > in that configuration. I believe this is an instance of this existing > gcc bug: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100990 > > As a workaround, move the mixed constness case at the end of > check_ptr_ptr_ctor to check_ptr_ptr_mixed_cv, and skip the body of > check_ptr_ptr_mixed_cv when building in C++20 mode with _GLIBCXX_DEBUG > defined. I also ran into this, and was thinking about how to fix this. What you propose is fine because these are unittests, and skipping them doesn't really break any GDB functionality. But what happens when we want to use this in actual GDB code? I guess we'll need to add casts at the point of use? But then, what's the alternative, avoid std::span for now? Though I'd be fine with that, I suspect others might disagree. Guess I'm not here to add anything constructive, just noting that this patch is just hiding the issue until it bites someone later on. Thanks, Andrew