From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x929.google.com (mail-ua1-x929.google.com [IPv6:2607:f8b0:4864:20::929]) by sourceware.org (Postfix) with ESMTPS id C1597385E836 for ; Thu, 2 May 2024 19:26:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C1597385E836 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 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C1597385E836 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::929 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714677982; cv=none; b=LQSfDGF3ZhRDSH6qQ0i/YBROa6TuzbaJU3UHp7Mxg6CP2ZB2IzSftZCiOqb2pI4zYhDzMcFkjoKi+VwHcDkS83a12RrxofReKp/gM55hwU9je/DnNJSJJkLl2zUL9KYoqPJgSHHGKNVIsgYDKoGgRxfcVdPZKyewxRgPSnRwt+M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714677982; c=relaxed/simple; bh=AITNdL63VM3cy5u8GI5MBrkMFOsz3qYIl2wN24jwGyo=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=THSiltVqUg3qkLwPPNZVBAGTJ6+wiDSBwAoGnQPBOpGlr0/dqBxHHPUdheq678TeSYdTSBJWBoBcO679rQc28WxV3bQNnb3k1KV/2cwl4SbC7prjB5vtmAyEpxoB4J2PtP+Ykm2CLP07J8hxeiUXSH6WhYeufh0YWlNXdJs69jM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ua1-x929.google.com with SMTP id a1e0cc1a2514c-7f395ac5b16so1001871241.0 for ; Thu, 02 May 2024 12:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.washington.edu; s=goo201206; t=1714677979; x=1715282779; darn=gcc.gnu.org; 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=u1Je62OSsxO4eijuykzixp181Pdzd+eQmk/LLXp58xw=; b=Z6wrOXAwwrELsM5pP2uOBSeMdIuqtXAp1qxNTOPP9nWP2DbIV9Jggb0rGO3YyybVyB r5zrHh4v5o+AWHVYURiHBFQyvRBsnQ46seLPbF5x9Sb9kelDrVtbKD4db47mp5hKBBya PIOXDhNoF+QRBXn4+xxYK62kqvk45QIUCS2Zg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714677979; x=1715282779; 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=u1Je62OSsxO4eijuykzixp181Pdzd+eQmk/LLXp58xw=; b=Ia5mQRR0RmQWiDdofHECOcs4rPP8eSV8P16+qRrTCdS5bzxhWQbWd2fsvd1uahGCWs 1hEr8iyo0AEhzmzgcQJy3fwCWoNBACAzInySHlHZs73vBo5JBVqruRZnuFBJbpTy85rP Nxuc0gsqfyVwyPo0pf/V4qqzcRkbb6c0HolUI2GgMGb8abQS6aOMi24J9eEy6HfuD10u CwJlHYpEoxZ2a7Aa8Tz7DXuQZfxKscJEiuvm30tpLXg+92aMDKqDxcjr8wvY4zrmngod c5WHl4VH1HkEFfbMAh1mTW/6yleTKcrhskoo4EceHWSfdFhY+HsrfjwRkUjrv0It36Un oX5A== X-Forwarded-Encrypted: i=1; AJvYcCVTv0+CtIJe6xbpGPSN2xTM6ZOY/Or63uXlzB07NnpBSz+ilUVxuoEu2Uc4/UlWRBypvAQfP/RKPLjAh/SD3SMBb315UnI= X-Gm-Message-State: AOJu0YzA9+IYW5LxvBiFi4yMyotVfWa8PN4O0+oLOs0vqdiPRwsgXBnv Rz8kgiHh+eHjSA1y8cGPboY51nhcM4FJD14VwjEfLOwq6geFKvy1HIvlrOpoCYj4WCx/0/GTt2u 3iYXY3AhFLH4Y3Xg9uPghCfIKgE4FnAkm0sdM X-Google-Smtp-Source: AGHT+IGsTqkVmYJPQ5/0vk42Gcwj9Os+mazR/lvP/ZYfuBUwxQJzj5HcH/DDG/phjw7NmJ32a/iWsSzfnPnJfkK5/zw= X-Received: by 2002:a05:6102:12ca:b0:47b:9844:8f8 with SMTP id jd10-20020a05610212ca00b0047b984408f8mr1276181vsb.6.1714677978895; Thu, 02 May 2024 12:26:18 -0700 (PDT) MIME-Version: 1.0 References: <20240221093616.4001742-1-kmatsui@gcc.gnu.org> <20240228192843.188979-1-kmatsui@gcc.gnu.org> <20240228192843.188979-22-kmatsui@gcc.gnu.org> <8b32b64d-8411-4792-9ffc-b81dbc189e52@redhat.com> <21abf361-86be-4c67-a845-9abc3a88a061@redhat.com> In-Reply-To: From: Ken Matsui Date: Thu, 2 May 2024 12:25:43 -0700 Message-ID: Subject: Re: Trait built-in naming convention To: Jonathan Wakely Cc: Ville Voutilainen , Jason Merrill , Patrick Palka , 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=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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 Thu, May 2, 2024 at 12:18=E2=80=AFPM Jonathan Wakely wrote: > > On Thu, 2 May 2024 at 18:38, Ville Voutilainen > wrote: > > > > On Thu, 2 May 2024 at 20:25, Ken Matsui wro= te: > > > > There was some discussion of how to name the built-ins back in > > > > https://gcc.gnu.org/pipermail/gcc-patches/2007-March/thread.html#21= 2171 > > > > but __builtin wasn't discussed. > > > > > > > > Apparently this naming convention follows the MSVC precedent: > > > > http://msdn2.microsoft.com/en-us/library/ms177194.aspx > > > > > > > > I notice some discussion of this pattern around Clang adding variou= s > > > > built-ins in https://github.com/llvm/llvm-project/issues/61852 > > > > indicating that this is a policy based on precedent. > > > > > > > > But I don't see any actual reason for this pattern other than that = it's > > > > what Paolo happened to do in 2007. > > > > > > > > I'm not sure what the right way forward is. Perhaps we're stuck wi= th > > > > the questionable choices of the past. > > > > > > > > > > Hmm, I personally prefer the __builtin prefix. However, it seems tha= t > > > we need to reach a consensus across MSVC, Clang, and GCC. Would this > > > be realistically possible? > > > > > > Until then, I think it would be better to use __ for all built-in > > > traits. What do you think? > > > > My 0.02: __builtin as a prefix doesn't serve much of a purpose. > > The main advantage is that it avoids clashes with std::lib components > that previously used the __is_foo name and which need to be renamed to > support a built-in of that name. I updated the parser to ignore the use of the same identifiers in existing codes, such as struct __is_pointer in bits/cpp_type_traits.h. It is working correctly so far, but for example, if there's a constructor, there would be clashes. https://gcc.gnu.org/git/?p=3Dgcc.git;a=3Dcommitdiff;h=3Ddf3559d951ba6572e25= 4a1bd1ef9a34b6e543325