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 6189F384AB44 for ; Thu, 2 May 2024 17:54:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6189F384AB44 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 6189F384AB44 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=1714672464; cv=none; b=ulVyG+6rCPbznwobNwOkb5ZE8ETa1eWTNs1YMXHwAgLI4cYo3Ef3KOU/spwhAPAF9Ty0pIqXP15glA5NfTd0z0QHXYH+e40TiU8puY9tnC7OT0J36UEQEJGo+bSD62ac1R26Mg6Ujvwa35tt3nSz4D5yfMxnnX7z4zjFso8uI7w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714672464; c=relaxed/simple; bh=FSgh5GFMrTDtPKzQoew37J2HYkesV1HKEcqL4Qv70Ls=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=IB4SxbWSbqxNwToOaYiu0Ju+/huo7v7hFc3MA5GcK3VzEB+mJxGGS9kIekpBSga8Oo0QYa3uPGJh+PeL5MuWBFzTVVnYIaPBEVEQH45k+x8EHLCSItE2Ks1L9FzRjv0oalgpxOS2KAx4pvOhnsJXjOoJn8QLEQ8rhmskmierkk8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714672461; 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=WwsQtJF81Cwsntny07N0PxxCRZWJic8owzGQi9rwR2A=; b=El3rChj10s0e5BVtRqEGCskxdjNw/+BEZRhPUHp3yAWORQIylkGQeqrLv+ftvfSTS2ltLN oHZHD2W/fzAygqKraDPAXQ+kc4jSVwBVzN8OyaZODPYZL52BsSNeFjrM9uBxSRb/FpeafF rJz1huI9vo43QtvkCQB9Npbqzn6AQ88= Received: from mail-yw1-f200.google.com (mail-yw1-f200.google.com [209.85.128.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-57-vEex2miPPFqu0oBKFcYkUg-1; Thu, 02 May 2024 13:54:19 -0400 X-MC-Unique: vEex2miPPFqu0oBKFcYkUg-1 Received: by mail-yw1-f200.google.com with SMTP id 00721157ae682-61be25000a4so79267547b3.2 for ; Thu, 02 May 2024 10:54:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714672459; x=1715277259; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WwsQtJF81Cwsntny07N0PxxCRZWJic8owzGQi9rwR2A=; b=YXE+2eZx7SHeatgxSc8DgIHXf2zCm2lqraXE+MCwFdakKL4cOJJCe/V6/E6JqolyzG D0XNUVtbb5dGZKUy3PQUx1NF4OFJAyo+QKlVPrtyA4cZPEHrkX8Q4+bbzSDOB75bsYCj Ie4iRNaRyojMOHANDtRiwDjQuJFqk9vBFHtD3yuurDZoF1j+4rMu/GKCxhcmzfGhoh2B sgor1yNMwz8QmD21y7356jZedyIzRHt0dgBCHvEzY51mqgA6eBpLSPWaYzE65UJETkCg st6dp8CCoYhST3T/OOc90psPvqNSrGzGSJBOAGOtflV38+u7/PoSg91RSa9ZOPfBEHrt mfqQ== X-Forwarded-Encrypted: i=1; AJvYcCWDZNhn0yLj64u2tuxwNuTlbk4THaIVZ2V5g2pR8xWQabc7YlRWgN46b37rzEuWqtgdUgftv6eyT2IVtiWm4te6UVAynkg= X-Gm-Message-State: AOJu0Yx6ESxXlf3FgR5KEQjAbCX4CGQBxGnQgKeHDBQRGIPNaX4bYw5q vmWzvskThtsQq3gTxArPCRTAvahcXUFcqt2hsOabAHul7oA8+7p4e/4pkRTJOLTd1fR1wKiU9dD g59dHjp8Mbol5Ygg9lwATOdLTRpgFNB0Rl8RYk59hz1PqtdGd24pX X-Received: by 2002:a81:fe07:0:b0:61a:bc2d:5186 with SMTP id j7-20020a81fe07000000b0061abc2d5186mr261766ywn.32.1714672459046; Thu, 02 May 2024 10:54:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFzQNh8O3ZnLDWf8ILrdWZdlMkoE6Ihx2Y0TvTqFieM1/RS5Rww4CxeDhXotF1siMX36OwZSA== X-Received: by 2002:a81:fe07:0:b0:61a:bc2d:5186 with SMTP id j7-20020a81fe07000000b0061abc2d5186mr261747ywn.32.1714672458606; Thu, 02 May 2024 10:54:18 -0700 (PDT) Received: from redhat.com ([2603:7000:9500:34a5::1db4]) by smtp.gmail.com with ESMTPSA id b10-20020ac8678a000000b0043718726f76sm664805qtp.90.2024.05.02.10.54.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 10:54:18 -0700 (PDT) Date: Thu, 2 May 2024 13:54:16 -0400 From: Marek Polacek To: Ville Voutilainen Cc: Ken Matsui , Jason Merrill , Patrick Palka , Ken Matsui , gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: Re: Trait built-in naming convention Message-ID: References: <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> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/2.2.12 (2023-09-09) X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Thu, May 02, 2024 at 08:37:53PM +0300, Ville Voutilainen wrote: > On Thu, 2 May 2024 at 20:25, Ken Matsui wrote: > > > 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. > > > > > > > Hmm, I personally prefer the __builtin prefix. However, it seems that > > 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. > Consider __is_constructible. It doesn't add value > to make that __builtin_is_constructible. It's a built-in. Of course > it's a built-in. It's a compiler-implemented trait, and > this is just the intrinsic that implements it. FWIW, I also like __is_constructible better than __builtin_is_constructible. > Most of the existing builtins for traits don't use a __builtin prefix. > Not in GCC, not in other compilers. They are indeed > just double-underscored versions of the traits. I think that's fine, > and consistent. There's precedent for this > across Embarcadero, Clang, MSVC, and GCC. See > https://clang.llvm.org/docs/LanguageExtensions.html > > Yes, I know it's inconsistent with other built-ins that aren't C++ > library traits. But the water's been flowing under > the bridge on that question for a while now. > > I would also prefer at least considering mimicking a trait builtin's > name if some other compiler did it first. That's not a hill > to die on, we don't need to be 100% compatible including the naming, > but if we can, we should just use a name that was > chosen by someone else already. It's just nice to have the same name > if the traits do exactly the same thing. If they don't, > then it's good and in fact very good to give our trait a different name. > Marek