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 064703856DCA for ; Wed, 19 Jul 2023 18:48:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 064703856DCA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689792516; 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=LMULFtp8ze//HJ64z+ppAIa8Iaq0vrYLh2KYuYoF5hI=; b=RsHVj3bPQypEHaJXde+n1cHNMo00UsQzo+RmqmPlaSxgqHxD/geAAgUyPQHj9nvumiDiLk Z+gsL/P1NE4birAOzWLis5YBO4HQgfxxvJda2+JUNENYURlcVf7OMhIT4ZU54U6QhpwaT5 MWDCsnlVDpWRbSMKo3MFI22h00JRPlA= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-219-NRoIkTdkP72Gp2t7dYh7rw-1; Wed, 19 Jul 2023 14:48:34 -0400 X-MC-Unique: NRoIkTdkP72Gp2t7dYh7rw-1 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-7656a0f8565so83665185a.1 for ; Wed, 19 Jul 2023 11:48:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689792497; x=1692384497; h=mime-version:references:message-id:in-reply-to:subject:cc:to:date :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LMULFtp8ze//HJ64z+ppAIa8Iaq0vrYLh2KYuYoF5hI=; b=EHvN7stb4Xls/aCERv11QR3sRzfxrNRdQpNuX2fz7uZ1fx/UjYlV25k6KvnaU6pxUP njhh4bq8L8qecIxxf5kJ3c4WtBrku/rEqXZkHWYN1B4E7XrmwNPb11WvP0dZPTeGev8z 2W9TXsOR1BlfppZLcAGbB4ZP9rQAM9kIZXhmC69qIVMqscdfWGtd1hIW1RkZtPZ1N3Ol pDCLgAEzVlMWrfSY89PKWhdSJeL3YxcJ0vLBghlsYoHx2ZAhci/vR6YM8ZKly80uJR7Z hZai6F3lHCdjZge4QiXxAZVViKnidu8FHQpI8SouMw83X/NE46lymMidWgGtLYc9M5uk CM1A== X-Gm-Message-State: ABy/qLYexeFSeLC54WEOCDFqlP6Zqo+nRowk5A99MitsoHisFhQl7kpy OEQVYxMNrEG7bYTvsYWGF4NrGWyy02/RAyaKcZIjUXbjAeM1qc/dQi8AWUgAOQAjhhR6C6lyHZL Nnfjy6xOp8RR8/1zL7+2hlC5QRg== X-Received: by 2002:a05:620a:4010:b0:75b:23a1:d853 with SMTP id h16-20020a05620a401000b0075b23a1d853mr4107631qko.21.1689792497591; Wed, 19 Jul 2023 11:48:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlHsZ0jRktxVMvMXalV2+r9wfE6EfMi6pCcyQqMnzAtjkCtsOg0RbKSsF1bZJkdh0MWwKp6suw== X-Received: by 2002:a05:620a:4010:b0:75b:23a1:d853 with SMTP id h16-20020a05620a401000b0075b23a1d853mr4107614qko.21.1689792497368; Wed, 19 Jul 2023 11:48:17 -0700 (PDT) Received: from [192.168.1.130] (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id i26-20020a05620a145a00b00767ceac979asm1453762qkl.42.2023.07.19.11.48.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 11:48:17 -0700 (PDT) From: Patrick Palka X-Google-Original-From: Patrick Palka Date: Wed, 19 Jul 2023 14:48:16 -0400 (EDT) To: Ken Matsui cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: Re: [PATCH] libstdc++: Define _GLIBCXX_HAS_BUILTIN_TRAIT In-Reply-To: <20230718223233.15328-1-kmatsui@gcc.gnu.org> Message-ID: <645412ed-82dd-fe17-d25a-68bbe0ccf8ac@idea> References: <20230718223233.15328-1-kmatsui@gcc.gnu.org> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-13.8 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 List-Id: On Tue, 18 Jul 2023, Ken Matsui via Libstdc++ wrote: > This patch defines _GLIBCXX_HAS_BUILTIN_TRAIT, which will be used as a > flag to toggle built-in traits in the type_traits header. Through this > macro function and _GLIBCXX_NO_BUILTIN_TRAITS macro, we can switch the > use of built-in traits without needing to modify the source code. > > libstdc++-v3/ChangeLog: > > * include/bits/c++config (_GLIBCXX_HAS_BUILTIN_TRAIT): Define. The ChangeLog entry should also mention the change to _GLIBCXX_HAS_BUILTIN, e.g. (_GLIBCXX_HAS_BUILTIN): Keep defined. > > Signed-off-by: Ken Matsui > --- > libstdc++-v3/include/bits/c++config | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config > index dd47f274d5f..de13f61db71 100644 > --- a/libstdc++-v3/include/bits/c++config > +++ b/libstdc++-v3/include/bits/c++config > @@ -854,7 +854,11 @@ namespace __gnu_cxx > # define _GLIBCXX_HAVE_BUILTIN_LAUNDER 1 > #endif > > -#undef _GLIBCXX_HAS_BUILTIN > +// Returns true if _GLIBCXX_NO_BUILTIN_TRAITS is not defined and the compiler > +// has a corresponding built-in type trait. _GLIBCXX_NO_BUILTIN_TRAITS is > +// defined to disable the use of built-in traits. > +#define _GLIBCXX_HAS_BUILTIN_TRAIT(BT) \ > + (!defined(_GLIBCXX_NO_BUILTIN_TRAITS) && _GLIBCXX_HAS_BUILTIN(BT)) Since we don't expect _GLIBCXX_NO_BUILTIN_TRAITS to get defined/undefined in the middle of preprocessing, perhaps we should factor out the _GLIBCXX_NO_BUILTIN_TRAITS test from the macro function and instead conditionally define the macro function to 0 according _GLIBCXX_NO_BUILTIN_TRAITS? > > // Mark code that should be ignored by the compiler, but seen by Doxygen. > #define _GLIBCXX_DOXYGEN_ONLY(X) > -- > 2.41.0 > >