From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe35.google.com (mail-vs1-xe35.google.com [IPv6:2607:f8b0:4864:20::e35]) by sourceware.org (Postfix) with ESMTPS id 083D63858C2B for ; Wed, 19 Jul 2023 19:32:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 083D63858C2B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=cs.washington.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.washington.edu Received: by mail-vs1-xe35.google.com with SMTP id ada2fe7eead31-440bc794fcdso13851137.3 for ; Wed, 19 Jul 2023 12:32:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.washington.edu; s=goo201206; t=1689795125; x=1692387125; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=5fQe8yxa2WF4fmKrPGlj0Rk6JWv1kizxIp7cjs3jg2U=; b=Td9vLqKqFpj/rSW1nrU3uOF5nt3KRyQxO4njuclXSdxSKIRIc1c3gqXxqnYpguAKps Q2PqayNHnWhk8ReXWhd9EomhfBY4UFG5ZrLcVdBaWjDVlbrP8VAh1ChKkYEpZMIu8TDR s8ScP/tJ2GP9xc/CnUozL44CI7MA7uewdonDg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689795125; x=1692387125; h=content-transfer-encoding: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=5fQe8yxa2WF4fmKrPGlj0Rk6JWv1kizxIp7cjs3jg2U=; b=CtLHIV8MgpI5zaMH5iznttCaXrgKq+YtqaMGfyq/eg1S87TrSz8WDFmrr6U2/pgU++ GUjN26Zv1SBUvzz4pFwKvCTubgnxHMtl29bCNPG89kX1AWdnAyITKD3jxQiTANAiRwYT itQogEIh9iM2p81RdYc0cDoGm1QEJLKs6noOOe+dYofwtA8Ud7trYeNXE5jppmYqgGOF lYffDMzOLE8+wXhrR+Vmf7xHm5EmI9AX3PaRU/50134utKtMpPZu+1z4kUWL2w/4cUS4 yu90G1OpR6HcXroVrgtLSKudRSVohNrsFc89jk+7y4MXWW5LSNa2AGkq/9rveWcYI3cO qEWA== X-Gm-Message-State: ABy/qLa01Ubtv4seQoi/cVadjn+8DQPs5IoUkEWvRvSZS+YQMw/05rav /wGpMEjXpGgDC8R7gOFa9GRuPFC2VeCFA0ZIzOyPtw== X-Google-Smtp-Source: APBJJlHyXiWdY7CAB98vwZv5Uuv2EJxQYswRET1/81fBAnulZU/0Bm8JkKGNpTNjyNg35d0bNKcUzq6vqqiY+W408yk= X-Received: by 2002:a67:bb0d:0:b0:443:874b:7d64 with SMTP id m13-20020a67bb0d000000b00443874b7d64mr2365378vsn.26.1689795124817; Wed, 19 Jul 2023 12:32:04 -0700 (PDT) MIME-Version: 1.0 References: <20230718223233.15328-1-kmatsui@gcc.gnu.org> <645412ed-82dd-fe17-d25a-68bbe0ccf8ac@idea> In-Reply-To: <645412ed-82dd-fe17-d25a-68bbe0ccf8ac@idea> From: Ken Matsui Date: Wed, 19 Jul 2023 12:31:48 -0700 Message-ID: Subject: Re: [PATCH] libstdc++: Define _GLIBCXX_HAS_BUILTIN_TRAIT To: Patrick Palka Cc: Ken Matsui , gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham 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, Jul 19, 2023 at 11:48=E2=80=AFAM Patrick Palka = wrote: > > 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_BUILTI= N, > 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 c= ompiler > > +// 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? > Hi, thank you for your review! I totally agree with your ideas and will update this patch. > > > > // Mark code that should be ignored by the compiler, but seen by Doxyg= en. > > #define _GLIBCXX_DOXYGEN_ONLY(X) > > -- > > 2.41.0 > > > > >