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 3BB093841125 for ; Tue, 5 Dec 2023 17:05:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3BB093841125 Authentication-Results: sourceware.org; dmarc=pass (p=none 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 3BB093841125 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701795950; cv=none; b=BHcOR2XJcc26JCA+1zWTxeVhn44+mhU1wS3nuuYu+CpIx9aYSigJlMyehUoZTHe4OxgSMeCEVdjpV1RvcqCMAt9J+npFriwiCjSmd6IbRRgxdKUYV6Ut/gZzCPabZueb+BCloaiCnaSEmHfm9vqp6bN5c71mgizvMhm3hOayoJ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701795950; c=relaxed/simple; bh=s8g5pbD7Ttw9U75ylDTMh0kUAdBcp2Lee6xIgmTJZC0=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=FUn2ET9sDbvByfDlyTIKAYxMnWrwF2ZPteN1JNGQ5aJMHRdmmwxf7dI3BOI6oa+41RqKvx1KD8tGmzzghNvp3U6w8h6e/siKhiIl2F52Kcnc85QapZF0l75UZSFeST4teFydytC5FtxvTxJKJ7mobVsclGiaVRbaYFGSvbuWc54= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701795939; 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=GZXMalxnveGWMFRsGu/2OVSA/fZKmPjtSKRswVIirPs=; b=XOBpalKLDt8Rre1tVzDeSWUslcEgJOIl64LKCVsjHDsIHVRYzruHbkOKceHBVJA6j07668 E20AQD22RNYP29IfCfghy2l1xtV7qTeUjiuH5e0CAeoQD6PiSmGod8rMneUOGzL6YlzK7T 4Ri2JTUuCsax9F0i/HIPnXRsDBOUIX0= Received: from mail-yw1-f199.google.com (mail-yw1-f199.google.com [209.85.128.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-441-l_l5H35yPzq1i8cS5pSieQ-1; Tue, 05 Dec 2023 12:05:23 -0500 X-MC-Unique: l_l5H35yPzq1i8cS5pSieQ-1 Received: by mail-yw1-f199.google.com with SMTP id 00721157ae682-5d42c43d8daso34815667b3.0 for ; Tue, 05 Dec 2023 09:05:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701795918; x=1702400718; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GZXMalxnveGWMFRsGu/2OVSA/fZKmPjtSKRswVIirPs=; b=YN/2p+aWUBbU26CHqU9KJbGpOONRNE3RQKGb6Yyu4+xE5k+Ix7OxpDja5WeVtWNcGG bXOwl3xWKUjAtkNTjnoqP2Lov0gF2piDb5gdZGlw9QizO9iYj1UCOCl5di8tMprWA4Qr KaGvqCxuoICYYJJzZEDqqjqZlFBTTnHso8vae9njFbYlx+tUMKp3ucRfUQfQT2bVQuok il8sHy4v4xfuPG47HlcTZ8mgFeKD1AX8WIPT917s/58UnSZ4Sb9YgsUU+dmMyWmRo3SV j7Igh6W1tmyJSWlVBvb6VM7rID1ZOurOoIj7nSXFo7ZIyVp9Xv0mrK+dRUV1vYHh0epk yEmg== X-Gm-Message-State: AOJu0YxJQFHAynGriZPz8W6BmKtzNY5LP8y80vZ0vLhClYhvU6GW1UHw TAtULTyNg0OKr4tPWgi7bcqqLe+QQB82IEnYp5BkU0Fyl1oZrpS0SG+1fJqaArdvNLhOVdUeXLk q0eP4gNq759fASwxZIJHT8NN9BZn93jCvAH11kHx/2jtu X-Received: by 2002:a05:690c:2b87:b0:5d3:53e1:b72e with SMTP id en7-20020a05690c2b8700b005d353e1b72emr1078098ywb.13.1701795918348; Tue, 05 Dec 2023 09:05:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IH9R3mJ4AJuytYG7yXt0pF36nKnDQn/TFBZmGJvpjfQgnBsX7HxScJQPCMjV6aR2nB11SIy0n3U2GPMC3utAlU= X-Received: by 2002:a05:690c:2b87:b0:5d3:53e1:b72e with SMTP id en7-20020a05690c2b8700b005d353e1b72emr1078095ywb.13.1701795917870; Tue, 05 Dec 2023 09:05:17 -0800 (PST) MIME-Version: 1.0 References: <20231120025547.2938444-1-jason@redhat.com> In-Reply-To: From: Jonathan Wakely Date: Tue, 5 Dec 2023 17:05:06 +0000 Message-ID: Subject: Re: [PATCH RFC] c++: mangle function template constraints To: Jason Merrill Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, 22 Nov 2023 at 14:50, Jonathan Wakely wrote: > > On Mon, 20 Nov 2023 at 02:56, Jason Merrill wrote: > > > > Tested x86_64-pc-linux-gnu. Are the library bits OK? Any comments before I > > push this? > > The library parts are OK. > > The variable template is_trivially_copyable_v just uses > __is_trivially_copyable so should be just as efficient, and the change > to is fine. > > The variable template is_trivially_destructible_v instantiates the > is_trivially_destructible type trait, which instantiates > __is_destructible_safe and __is_destructible_impl, which is probably > why we used the built-in directly in . But that's an > acceptable overhead to avoid using the built-in in a mangled context, > and it would be good to optimize the variable template anyway, as a > separate change. This actually causes a regression: FAIL: 20_util/variant/87619.cc -std=gnu++20 (test for excess errors) FAIL: 20_util/variant/87619.cc -std=gnu++23 (test for excess errors) FAIL: 20_util/variant/87619.cc -std=gnu++26 (test for excess errors) It's OK for C++17 because the changed code is only used for C++20 and later. That test instantiates a very large variant to check that we don't hit our template instantiation depth limit. Using the variable template (which uses the class template) instead of the built-in causes it to fail now. So optimizing the variable template is now a priority.