From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id C6BBF3858C2C for ; Fri, 4 Feb 2022 12:44:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C6BBF3858C2C Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-507-BU1FtDFwOtyIgulJjG5nUg-1; Fri, 04 Feb 2022 07:44:34 -0500 X-MC-Unique: BU1FtDFwOtyIgulJjG5nUg-1 Received: by mail-wr1-f72.google.com with SMTP id h2-20020adfa4c2000000b001e26b5f1ec5so1948044wrb.13 for ; Fri, 04 Feb 2022 04:44:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jACkId27SviL2TKIrbe0Q89MQU6XlkBsqxRz9mEoMJg=; b=d35/nO2dKkg4TgDGG6AUPkPHB6OdKiaYY0UbONTYA8ktKm31zdSpx66YRNpjNRPpK0 MHol3ZdgBii6OTSzsTs9GGFye4ZKWQSENNINkTtall6jx3Bsm83cOCsto4qd84O1ywI4 FWeg25Hc5l8R4rcKn58QZjAk4PP3bbpEt0BY+UzEzOzgoSOXzWx9CoEDhEUdD304i5c2 Oigwulzvw6mkvSlpkBckKrNemYqqxLxd+yAs/sVMIjTfA/UKdEot3MvwrqVMs/pvysQK ArfIz3+O6Bf/7M6XwnPxau1erNiHXttT688EpaYjsoW249DAIKyz6yBUtPYQxSuPx+C9 7J/g== X-Gm-Message-State: AOAM533EvA7RHsy0zUia63l3aVrdnS5p3YPrg2ujvy4mC6lw5kg0xXQI kVYjsRnsXKXwg5ePtxZHHCST+d3ejRKlARAGYOJirhki9OtRhJiEC4/aAiLRE0gh+XJbU5fa/il 34wPBBSf4gfMmjH8FVnks9g== X-Received: by 2002:a1c:7410:: with SMTP id p16mr2097602wmc.16.1643978673436; Fri, 04 Feb 2022 04:44:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJzBi9dD0NPiY7tcy6r9waK6z1JacB//V8cAfwRIQax/EDCbFMna7WmH45ouSr1tRCUDg0/bAA== X-Received: by 2002:a1c:7410:: with SMTP id p16mr2097593wmc.16.1643978673200; Fri, 04 Feb 2022 04:44:33 -0800 (PST) Received: from localhost (host86-140-92-93.range86-140.btcentralplus.com. [86.140.92.93]) by smtp.gmail.com with ESMTPSA id r2sm2252062wrz.76.2022.02.04.04.44.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Feb 2022 04:44:32 -0800 (PST) Date: Fri, 4 Feb 2022 12:44:31 +0000 From: Andrew Burgess To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 0/4] Add variant type Message-ID: <20220204124431.GB1917497@redhat.com> References: <20220201140717.3046952-1-simon.marchi@polymtl.ca> <20220203000206.GA1474789@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 12:43:59 up 11 days, 3:30, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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: Fri, 04 Feb 2022 12:44:39 -0000 * Simon Marchi via Gdb-patches [2022-02-02 20:32:45 -0500]: > On 2022-02-02 19:02, Andrew Burgess wrote: > > * Simon Marchi via Gdb-patches [2022-02-01 09:07:13 -0500]: > > > >> I sometimes encounter situations where I think using std::variant would > >> be useful. The benefits would be to be able to use non-POD types in the > >> alternatives, have them automatically constructed when making an > >> alternative active, and automatically destructing them when switching to > >> another alternative of destroying the variant. Also, the validation of > >> access to the alternatives, to prevent accessing an alternative that is > >> not the current one. > >> > >> However, std::variant is only available in C++17. I suggest that we > >> import a variant implementation to allow us to use it right now, a bit > >> like we did for optional and string_view. We could maybe import the > >> implementation from libstdc++, like we did for these last two types, but > >> that sounds really tedious (we would also want to import any tests). > >> Instead, we can take advantage of a popular implementation distributed > >> as a single header file. I chose this one: > >> > >> https://github.com/martinmoene/variant-lite > >> > >> because it is close to the std implementation, and the license (Boost > >> Software License) is clear and compatible with the GPL v3. > > > > Is this compatible with the copyright assignment requirement of > > contributing to GDB? > > > > I'm assuming copyright of that file is not assigned to FSF. > > Exactly, we're merely redistributing it (as its license allows). Its > header does not say "Copyright FSF" like the other files. > > > My concern would be, what if code was copied from that file into the > > rest of GDB? Does that cause us problems? > > Well, we should avoid that :). I see it exactly like zlib, which is also bundled. OK. Thank you for the explanation. I took a look through this whole series, and it all looks good to me. Thanks, Andrew