Message ID | 20240110220813.2501087-1-ppalka@redhat.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp1108615dyi; Wed, 10 Jan 2024 15:12:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IFg9fPImFXRpSH0dtsZyJpoGMIs44Sm8cN2G0pyLuWjq4dhSrevywfEkNvcXAkWdwAZKWAg X-Received: by 2002:a05:620a:394f:b0:781:d8e1:446f with SMTP id qs15-20020a05620a394f00b00781d8e1446fmr462080qkn.119.1704928355906; Wed, 10 Jan 2024 15:12:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704928355; cv=pass; d=google.com; s=arc-20160816; b=yslZSfXjmSBQwBkrJqxWMiMn3+X+SBF04tdx48S3zXPnu5C784Fwrtat/ecZmjwtQY DbAAS4LXmxyLEU4sDloE19pXjO8mwh/cMVJQm5gFMt6cVWHp141sUdoVeb8P93G42cfH aRCtSAO5bzV85u81eo/YJBC9IHNXI+ogdkfOSb1N/ENA6ZlwdM+7WATq2/FPUMI/pzrW X1vpXNIImq6UqpLHBWiJ6a/wNdnRLMj9+sijt3Bv4/+trGb0nRAyNKuY3g1wDVWZHpFB m6kmtxzp78H6Ra9zO39VKIorNGWaHBtThgK8AnMBAxmP0jG8JuxfyfRDLR7LsZsovBTT RC0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=8wcSALA+hD6vMLuECxIHC+a52jV0R+NzLXIhbNY256U=; fh=EVSvWd94bH3+6DLHxQIQnUkCnGLOu/mRCJOpcO366zA=; b=e0pLIgWiaJHOOJnZEr+JZa8MUQpkBJLBdEOtXXN8Tu5f8dqEneq3HZH2iNbpHL3uTl IpPgp4jfwoOkZRN64Yg+ZHmh3phFTOsCdC52V+hBcdc7GYOM22jOQp/6Fqc5/FzEkAgw cpHmE7dalrQejnMPCMVZnU+MPAjfKq7PAJrnadK9tGQ3hulAL+crGuBsuubQzbP0s8TP 0AaUHagPXvA0Uxe6NKXAwlyq6OBVjUc4NkHjNC29YB3DgOr3p6wheAkqqZEKvgYnjSZJ zPqgCnaL4GGm75369ivDM8sJHlQnrBvjlKxfhANUVO5mhp6YdbzDnCJc+LOGAEipcprf PqvA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cQh7k0G1; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ou22-20020a05620a621600b00781e293c517si4708873qkn.471.2024.01.10.15.12.35 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 15:12:35 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cQh7k0G1; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C1E20388267C for <ouuuleilei@gmail.com>; Wed, 10 Jan 2024 22:09:31 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 5695C3881D24 for <gcc-patches@gcc.gnu.org>; Wed, 10 Jan 2024 22:08:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5695C3881D24 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 5695C3881D24 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=1704924507; cv=none; b=Vg32H9echUu8xdcsbCWKA+UQlJJYYQQ9fnPIMoYiJX25xNlp/lEH4EEEVgQt9DhY8mTb2Mas5Y6ejHVQPXNiPr5XycYqwU9NPtev8rp9YKU8QSX5hqkkJpKISP+qN/jYFxjiHfGW2fab+dKljRNLrDQTJWhJUrNybxVM53ZmuVE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704924507; c=relaxed/simple; bh=XFpdKLs6ki0sChLWc/t9EMRvWvHAIiXnmxtNoVtwZQ8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=nvCjPy5y/ll9zThIGK8PrHm3PFVbJW6Cgj0+hRZj3QOKJr0aWtpco5eeTXXt7McVUY/RcsCDjUi+A1X1pcfYhKDAFOjquHH7+4ZqKQwOaObjQM+G62uA+wgMJwE73/fL44hKDsMpuXpQ7gKkz2abrrVnU4iI43ICAaaWHeEd5k8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704924505; 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: content-transfer-encoding:content-transfer-encoding; bh=8wcSALA+hD6vMLuECxIHC+a52jV0R+NzLXIhbNY256U=; b=cQh7k0G1ypnscykMdF8RgS4Dc/Gu5uCtS2QEzfW7M8wiWrx+0Mw4C07VpYccQfoR+AeOKg s7KNPw9OTHxEvbtn1pPm2NCI9XUqiKQJXG+rosoduAa54pGRGyjQfwCRL404YiXwC3Tr/E kIyM/F3mI1QSJgHsWQkKPdQlkjXmKKg= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-319-9AT6vzc5MPaQWA0PrrNMzw-1; Wed, 10 Jan 2024 17:08:18 -0500 X-MC-Unique: 9AT6vzc5MPaQWA0PrrNMzw-1 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-4299df5e5f0so37701871cf.1 for <gcc-patches@gcc.gnu.org>; Wed, 10 Jan 2024 14:08:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704924496; x=1705529296; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8wcSALA+hD6vMLuECxIHC+a52jV0R+NzLXIhbNY256U=; b=uTkPqeBinUrv4n4ihaS71FPDOSpci2qVw9WmwMCXLkAvN1sJo8Sle3FjuUHx0aD0oZ 42VYgGqkSKg07gbjlJC4uw8Pp3+Lwwf8IrfBCsv10VzcJJ2y4OEZCLRtg9UQCdza3bGe VvvyTjxZC0gYwWUqmxNviF3JdO8FJ0yzZwss97WsHp9M/6Kkgj5KoFCYEU1yLSfDZbQf D1SmVsztk0H8Q1EHqYoWyUTgnAiBJT+YfKRoLDrvMM4waSZHC22pDCKdrg2KHMuWHLpB LIn+sy4mPxXZp3i8dy6eWmQQELmJlX/W2EJ0jUaCg6Q7xb065BCLSEdE0hkyHxc8KbM6 Io4w== X-Gm-Message-State: AOJu0Yzu0OqVgnJgyQA9LAaimvrQsrKoApqNisaIrmZMe0JiCu8HsEwj A77etcpsjJJ0ZRtk8EyCxBTMm+z7T2tITGABCKrhJjCzJgIa0mlUTgAVMZ3hCZEpAPyA/sTGkyQ CUBQIbA0AK57ur97vPs6e2MJaYj74cefhwkDz5LOCNoDwtEjLKmlw2RFNaFhJeGpjQCISL4ZE0V BpO0WWOLE= X-Received: by 2002:ac8:5a49:0:b0:429:8aa4:9813 with SMTP id o9-20020ac85a49000000b004298aa49813mr206889qta.111.1704924496601; Wed, 10 Jan 2024 14:08:16 -0800 (PST) X-Received: by 2002:ac8:5a49:0:b0:429:8aa4:9813 with SMTP id o9-20020ac85a49000000b004298aa49813mr206877qta.111.1704924496243; Wed, 10 Jan 2024 14:08:16 -0800 (PST) Received: from localhost.localdomain (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id v17-20020ac87491000000b004283f2208e4sm2099629qtq.87.2024.01.10.14.08.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 14:08:15 -0800 (PST) From: Patrick Palka <ppalka@redhat.com> To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org, Patrick Palka <ppalka@redhat.com> Subject: [PATCH] libstdc++: Use _GLIBCXX_USE_BUILTIN_TRAIT for _Nth_type Date: Wed, 10 Jan 2024 17:08:13 -0500 Message-ID: <20240110220813.2501087-1-ppalka@redhat.com> X-Mailer: git-send-email 2.43.0.283.ga54a84b333 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-14.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787746956044260086 X-GMAIL-MSGID: 1787746956044260086 |
Series |
libstdc++: Use _GLIBCXX_USE_BUILTIN_TRAIT for _Nth_type
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Patrick Palka
Jan. 10, 2024, 10:08 p.m. UTC
Tested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Since _Nth_type has a fallback native implementation, use _GLIBCXX_USE_BUILTIN_TRAIT when deciding whether __type_pack_element is available so that we can easily toggle which implementation to use. libstdc++-v3/ChangeLog: * include/bits/utility.h (_Nth_type): Use _GLIBCXX_USE_BUILTIN_TRAIT instead of __has_builtin. --- libstdc++-v3/include/bits/utility.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed, 10 Jan 2024 at 22:08, Patrick Palka <ppalka@redhat.com> wrote: > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? OK (thanks, this was on my TODO list). > -- >8 -- > > Since _Nth_type has a fallback native implementation, use > _GLIBCXX_USE_BUILTIN_TRAIT when deciding whether __type_pack_element > is available so that we can easily toggle which implementation > to use.
diff --git a/libstdc++-v3/include/bits/utility.h b/libstdc++-v3/include/bits/utility.h index 45d7241da9f..d8a5fb960fe 100644 --- a/libstdc++-v3/include/bits/utility.h +++ b/libstdc++-v3/include/bits/utility.h @@ -225,7 +225,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif // C++17 -#if __has_builtin(__type_pack_element) +#if _GLIBCXX_USE_BUILTIN_TRAIT(__type_pack_element) template<size_t _Np, typename... _Types> struct _Nth_type { using type = __type_pack_element<_Np, _Types...>; };