public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Roy Jacobson <roi.jacobson1@gmail.com>
Cc: Ken Matsui <kmatsui@cs.washington.edu>,
	gcc@gcc.gnu.org,  "libstdc++" <libstdc++@gcc.gnu.org>
Subject: Re: [GSoC] Conflicted Built-in Trait Name
Date: Mon, 27 Mar 2023 22:58:54 +0100	[thread overview]
Message-ID: <CACb0b4noAo_k_7VBVw8JPWHpNL0eswWDbLVryJ47_AoyBNXDsA@mail.gmail.com> (raw)
In-Reply-To: <CACpPL6snO4YpypAj4JeEO=eSzFnayDEqLfJGF8VNY_55A_jqpA@mail.gmail.com>

On Sat, 25 Mar 2023 at 12:23, Roy Jacobson via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> Clang has been providing __is_void for a very long time now, and is
> definitely compatible with libstdc++. Does defining this builtin cause a
> problem? Might be that the lookup rules for builtins are different or
> something.
>
> https://clang.llvm.org/docs/LanguageExtensions.html#type-trait-primitives

Clang has special hacks that allow it to handle libstdc++ headers.
When it sees the use of a built-in trait like __is_void used as an
identifier, it disables the built-in and treats it as a normal
identifier for the rest of the translation unit. GCC doesn't do that,
so "it compiles with Clang" isn't really relevant here.


>
> On Sat, 25 Mar 2023 at 15:08, Ken Matsui via Gcc <gcc@gcc.gnu.org> wrote:
>
> > Hi,
> >
> > I am working on the GSoC project, "C++: Implement compiler built-in
> > traits for the standard library traits".
> >
> > Built-in trait naming simply adds two underscores (__) to the original
> > trait name. However, the same names are already in use for some
> > built-in traits, such as is_void, is_pointer, and is_signed.
> >
> > For example, __is_void is used in the following files:
> >
> > * gcc/testsuite/g++.dg/tm/pr46567.C
> > * libstdc++-v3/include/bits/cpp_type_traits.h
> >
> > In this case, are we supposed to change the existing same name in the
> > code to something like ____is_void (four underscores)? Or is it better
> > to break the naming convention of built-in traits like
> > __is_void_builtin?
> >
> > Sincerely,
> > Ken Matsui
> >
>


  reply	other threads:[~2023-03-27 21:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-25  7:53 Ken Matsui
2023-03-25 12:23 ` Roy Jacobson
2023-03-27 21:58   ` Jonathan Wakely [this message]
2023-03-27 22:48     ` Ken Matsui
2023-03-25 12:38 ` Marc Glisse
2023-03-26  2:01   ` Ken Matsui
2023-03-27 17:33     ` François Dumont
2023-03-27 20:16       ` Ken Matsui
2023-03-27 21:43         ` Jonathan Wakely
2023-03-27 21:49           ` Jonathan Wakely
2023-03-27 21:55             ` Ken Matsui
2023-03-28 21:29       ` Ken Matsui
2023-03-28 23:24         ` Jonathan Wakely
2023-03-28 23:33           ` Ken Matsui
2023-03-30  5:11             ` François Dumont
2023-03-30  8:33               ` Ken Matsui
2023-03-30 12:23                 ` Jonathan Wakely
2023-03-30 18:44                   ` Ken Matsui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACb0b4noAo_k_7VBVw8JPWHpNL0eswWDbLVryJ47_AoyBNXDsA@mail.gmail.com \
    --to=jwakely@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=kmatsui@cs.washington.edu \
    --cc=libstdc++@gcc.gnu.org \
    --cc=roi.jacobson1@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).