From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by sourceware.org (Postfix) with ESMTPS id DFB6D3858404 for ; Tue, 9 Nov 2021 22:48:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DFB6D3858404 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f49.google.com with SMTP id i5so618940wrb.2 for ; Tue, 09 Nov 2021 14:48:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=O7xCfpByjC1ReXH0pMwsnQbLubkqE6D8l+h5vRuFuh0=; b=FIReZ28zyhvGeeqdDNCk9NPkwGvr0qhsJQYPyKo18qU/G7M19lVSOOWGZSGF+sOWn4 UbcieA3Fe1tLJNHJrRVDKp4VqDmhDYE914/d71Ph/k0/FeYzIbNkTF2q2jKS5HFOAH3w B/CQn08JGay6vJNo5GMUdmuTyRxlyzGC6pQ3x/dANIa4RjjjnZ8sudCE98B1w+ANFe0Z P72XyhVtchOzJehNg0gDAuTvV6xNj0JkhtjDvZDg+MoSElb3Whp1qIxqsleyiG31P9yp 2wU/JzfQRm/bhQF+4b+LbycL5qz/eB1ZmXYF0IsHXTo/ktpQ0ccFt1SwGpH3ULmold1K eyNA== X-Gm-Message-State: AOAM530uodE0Z7Q+rukjP35AREbwaf60Ef/h8g4T/s0mouDyZeTTakjS 0WVxBAO0I1bvVn5X21mzi5w= X-Google-Smtp-Source: ABdhPJygv6WfiUTIERPJf2bIA3fpiat4F3u51UwXV4lJPAP0ItuMSRWvBeLK6gdQ1+mvtt760DjUUA== X-Received: by 2002:a5d:648e:: with SMTP id o14mr14423291wri.69.1636498097779; Tue, 09 Nov 2021 14:48:17 -0800 (PST) Received: from ?IPV6:2001:8a0:f912:1a00:d3db:ac91:4b9e:1449? ([2001:8a0:f912:1a00:d3db:ac91:4b9e:1449]) by smtp.gmail.com with ESMTPSA id 21sm3642446wmj.18.2021.11.09.14.48.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Nov 2021 14:48:16 -0800 (PST) Message-ID: <0ba86bea-3079-0b93-ad5f-4af5119695df@palves.net> Date: Tue, 9 Nov 2021 22:48:15 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH] gdb::array_view slicing/container selftest - test std::array too (Re: [PATCH v2 2/2] Improve gdb::array_view ctor from contiguous containers) Content-Language: en-US To: Lancelot SIX Cc: gdb-patches@sourceware.org References: <8acafb4f-ef32-2de8-e71f-8243386b8159@palves.net> <20211103222015.50988-1-lsix@lancelotsix.com> <20211108230217.sejrgqlvs4ju2c2c@ubuntu.lan> <7300bb4f-c171-8646-41ec-3753a77cad4b@palves.net> <20211109215848.h3caszzxf4lztjq7@ubuntu.lan> From: Pedro Alves In-Reply-To: <20211109215848.h3caszzxf4lztjq7@ubuntu.lan> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2021 22:48:21 -0000 On 2021-11-09 21:58, Lancelot SIX wrote: > On Tue, Nov 09, 2021 at 05:52:20PM +0000, Pedro Alves wrote: >> Thanks. Looking again, I noticed we don't exercise construction from std::array containers, >> unlike other tests. This adds it. WDYT? > > Hi, > > Actually my first version used a fixed size std::array exactly as you > have here. I went for a std::vector instead in the version I have > submitted to the list so I still test against one of the standard > containers while not having to define StdArray1. > > I am absolutely fine including a test with a std::array. It could even > replace the std::vector based test since this test is the only one that > uses this container (in which case the '#include ' line could > also be dropped). > > In the end, both options check that the old erroneous behavior that > used to allow slicing now fails to compile. This is the most important > point. The main advantage that I was thinking is that testing more than one standard container here ensures that we're not baking in some assumption in the interface (now and forever) that only holds true for std::vector. I'll merge the patch. Thanks, Pedro Alves