This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC / Patch] C++/26099 or front-end support to type traits
- From: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: bonzini at gnu dot org, "'gcc-patches at gcc dot gnu dot org'" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 13 Mar 2007 17:15:56 +0100
- Subject: Re: [RFC / Patch] C++/26099 or front-end support to type traits
- References: <45F6C6C1.9080507@suse.de> <45F6CA64.2050308@lu.unisi.ch> <45F6CBEE.4080004@suse.de>
- Reply-to: bonzini at gnu dot org
>> For the syntax, I'd prefer something like
>> __trait__<__has_trivial_constructor__> (x) which reminds attributes
>> (but with a C++ touch on it!) or, alternatively,
>> __trait__<x> (__has_trivial_constructor__). It also does not
>> require the proliferation of keywords in the scanner since you
>> can parse an arbitrary identifier and compare it with strcmp.
>
> Well, there is a problem that it would be the first time we usr this
> kinf of syntax, which also doesn't match the Intel version of these
> builtins (I took that and added a __gnu_* in front as Mark recommended
> time ago):
I see. With the added "__gnu_", however, the syntax is still
incompatible; my proposal can be mapped to the Intel syntax using
#define __has_copy(x) __trait__<x>(__has_copy__)
or something like that; and I guess I should have spelled it
__gnu_trait__. If adding one keyword only means that we can
remove the "gnu", however, IMHO this would be a point in favor of
my proposal.
But it's your and the C++ maintainers' call, obviously.
Paolo