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 506B03858D37 for ; Thu, 3 Feb 2022 00:02:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 506B03858D37 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-669-qONs7CRTMaGS74ykyW5ZbA-1; Wed, 02 Feb 2022 19:02:08 -0500 X-MC-Unique: qONs7CRTMaGS74ykyW5ZbA-1 Received: by mail-wm1-f72.google.com with SMTP id l16-20020a7bcf10000000b0034ffdd81e7aso540038wmg.4 for ; Wed, 02 Feb 2022 16:02:08 -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=ZtKayeb7/GCFvWtNXEzaRL5CvWTT8UURCwBlduBqmfM=; b=jvBzzWYi5NR5Ht/myTsmxcf4rTiO/+DaBQkP9rWtRjr2U5uptYuL8NgG8l6XyHEzUP 3rnqm7tKZuLHmgDE7A1vIsEGf8BlSaV8Q6mCwkHpYeL9lEoEpHnQ7ehOcUW7wVvq/nGe 8v+u9tj5x2qD/CvXXunlaKM8Dxu4sNGFt56UhpQ2vYilRVZnR3oenL96d2T0eNdL0+zo R4pbjs4Bjwgks+uV9+zGm/8igSN9VpzyRjAky6jCypzorOxW/n+ERk7TsbDHweomh8YO RW2R/AEM5rZcy4KynvgcR+u1bSRB2s4Ar6um0cFuiKPP9O/UL46gU3tQDdnhoGU/Jc6j +R5g== X-Gm-Message-State: AOAM531sgifWXeYFO/N85hZ3YjJqSJYPuNYUx8W8WDxHn+UvV0Mx6Bj5 qU5mI7i8XYHPgHDGX6gM5Rs0h+h0B/DAS1hoQPlBFcPv61ntNgUgvWVwI4gpvPMuujDUbba2fZo +s2J3GwLHg/UKCTo7Pk1Oxg== X-Received: by 2002:a1c:6a11:: with SMTP id f17mr8121891wmc.183.1643846527538; Wed, 02 Feb 2022 16:02:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJz1XIy2mc2YFlCapH9MXM56t+nAdntQKbL1tXFG3JPCR39a7OVeCWezTDtAExJa9vaXIeDqNw== X-Received: by 2002:a1c:6a11:: with SMTP id f17mr8121885wmc.183.1643846527325; Wed, 02 Feb 2022 16:02:07 -0800 (PST) Received: from localhost (host86-140-92-93.range86-140.btcentralplus.com. [86.140.92.93]) by smtp.gmail.com with ESMTPSA id ay29sm5844219wmb.38.2022.02.02.16.02.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 16:02:06 -0800 (PST) Date: Thu, 3 Feb 2022 00:02:06 +0000 From: Andrew Burgess To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 0/4] Add variant type Message-ID: <20220203000206.GA1474789@redhat.com> References: <20220201140717.3046952-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 In-Reply-To: <20220201140717.3046952-1-simon.marchi@polymtl.ca> X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 23:54:43 up 9 days, 14:41, 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=-5.7 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: Thu, 03 Feb 2022 00:02:13 -0000 * 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. My concern would be, what if code was copied from that file into the rest of GDB? Does that cause us problems? Not trying to cause problems, just making sure we've considered this. Thanks, Andrew