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.133.124]) by sourceware.org (Postfix) with ESMTPS id 1D899385828E for ; Thu, 2 May 2024 17:12:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1D899385828E 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 1D899385828E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714669935; cv=none; b=J9m68Sg3Ku8H4Usc3s/L3iJLSjeBY46/V6zTBdye6R/EvZ/vJQihdQ3XNF1+ngeW5p5DGp4rHJfmvnbOtXIpul1V7yKlA2EAaNKzC0Ti8MM59EGkuZ+jCm6NB7ZKn4lako3guHe8YJLYIoXzabrFzBjrbJEvlGGX4j/0tlrObwU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714669935; c=relaxed/simple; bh=jeJezBvoCNO3dfN0Gs+Bu+9qhuM2FshcTNPBqqW4s6s=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:From:To; b=m3OKn/Bnd06fURG9HOE3Xe5zqxiUHShMqVpcGG44QxN/30tuyhjO45lRKdq2cRtQWY6WDhOiziIT6bPZOWRxwe4RJO5oPkWm7oaZ9i+hbbkvma+gledaDVq0xPddvdDjZC4Xhx9BbskbRPrUG7/Q9/1C0pL/XJdXARiQclKyh9s= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714669933; 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: in-reply-to:in-reply-to:references:references; bh=XZSdXj3S46e9VuLmo2YuJIh1qGInG+VYW6N1qzWYJOM=; b=AJe5j2npf2OnA1JEHUld5LZSUn/6dBs0R0/b1/Kom9a16U2ltmRuMEJMS5U7ZMdHzSadzX y4oztC1tHa1hVwS/5mnTaij+wE24iHOCf1Kgpaw6jt/ww9RefcR6/M9N7axnxBl3jVkJfU z9iUd2mUfAc6XVDRvvtywVgK46g6uHQ= 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-670-fpsjGoWbPRWoy2Qs5sPX5Q-1; Thu, 02 May 2024 13:12:12 -0400 X-MC-Unique: fpsjGoWbPRWoy2Qs5sPX5Q-1 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-79067807374so1242860685a.2 for ; Thu, 02 May 2024 10:12:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714669932; x=1715274732; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XZSdXj3S46e9VuLmo2YuJIh1qGInG+VYW6N1qzWYJOM=; b=w4cRTrXzgjfMVfE0x8IlqYpCOX4xixjtVA4FiUHJontVARf89eGJNtWg1xJTTcjAfz pGPRqK9M5gEeEGbqXAPP48eiRlrG2Y8/1PWsZBYHKGSPWy0qhqlsSnZB913Zjof2hp0R imqbZNyX+VnTmT3p8O92ZsTfqD7qe6Nm4yLpok1YQVKa82EIgxTAaH3UQLio9REK7nwh /um2O/EfXWsp5dEHqyppkVMiZ8djtgT+ASHYiYEuTLnZ3r91lOB9RK9XMZz33TcvZrBo P+U2OSK9Q16+0UC4FgXm6Atu7Czcik8OwmnLWMzaFKzHFA0tJA8f549SwhwJPnR5W/t2 nLvQ== X-Forwarded-Encrypted: i=1; AJvYcCVarI5eHBRfHyTTKC4Q+lAYAiPbdjQ+p8u9a0MtFG1qY836sKxZzM/edrGtk72vfmU6pJhRiKz4YjqgbOSz8LVIOXWDbp0= X-Gm-Message-State: AOJu0YwIbpAi0SBqXVY4jaMYHMvHEWfVWr0QTzzFwQYJQa7JIMelUxK/ ukTX/3MZjvM23GnBXhZ74cJsMOBp61UkXpIESMPTSBChq7yOsOz6L5eJhvhmLhiNHowCOtcSED1 vIvBWmfi1c2nTn9zY0QpIqZ8xBSRBgVihAlY/PxHZJhNZX5r23EdF X-Received: by 2002:a05:620a:1a1b:b0:790:f253:62cd with SMTP id bk27-20020a05620a1a1b00b00790f25362cdmr324018qkb.14.1714669931809; Thu, 02 May 2024 10:12:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH6/V4f6rtiuhEgcwXGMPqmH2dtT7ZLaevYdppkR2d0QU5YmniHRtGzxbvbUn6WKWy/MhVG/g== X-Received: by 2002:a05:620a:1a1b:b0:790:f253:62cd with SMTP id bk27-20020a05620a1a1b00b00790f25362cdmr323988qkb.14.1714669931446; Thu, 02 May 2024 10:12:11 -0700 (PDT) Received: from [192.168.1.130] (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id a2-20020a05620a102200b0078ee7bad7a2sm514099qkk.3.2024.05.02.10.12.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 May 2024 10:12:11 -0700 (PDT) Message-ID: Date: Thu, 2 May 2024 13:12:10 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Trait built-in naming convention From: Jason Merrill To: Ken Matsui , Patrick Palka Cc: Ken Matsui , gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org 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: <21abf361-86be-4c67-a845-9abc3a88a061@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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 5/2/24 12:45, Jason Merrill wrote: > On 5/2/24 12:20, Ken Matsui wrote: >> On Thu, May 2, 2024 at 8:34 AM Ken Matsui >> wrote: >>> >>> On Thu, May 2, 2024 at 8:16 AM Patrick Palka wrote: >>>> >>>> On Tue, 30 Apr 2024, Jason Merrill wrote: >>>> >>>>> On 2/28/24 11:26, Ken Matsui wrote: >>>>>> This patch implements built-in trait for std::rank. >>>>> >>>>> __rank seems too short, maybe __array_rank? >>>>> >>>>> Actually, it occurs to me that perhaps we should have been adding >>>>> __builtin to >>>>> all of these rather than just __ and the library trait name.  I >>>>> guess it's too >>>>> late to do that for the GCC 14 traits, but we could do it for this >>>>> group? >>>> >>>> Clang already implements many of these built-in, without using >>>> "__builtin" in their name.  Shouldn't we be consistent with Clang where >>>> we can? >> >> Since I had already replaced the prefix locally with __builtin, I >> submitted patches addressing all other Jason's reviews with that. >> Please let me know if we want to use __ and __array_rank. > > If Clang already has a corresponding built-in (as with __array_rank, > apparently), let's use the same name; otherwise let's add __builtin to > the new ones. Eh, this could probably use more discussion. The practice of omitting __builtin from type-trait builtins goes back to Paolo's r123366 (cb68ec50) for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26099 There was some discussion of how to name the built-ins back in https://gcc.gnu.org/pipermail/gcc-patches/2007-March/thread.html#212171 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 various 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 with the questionable choices of the past. Jason