This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC / Patch] C++/26099 or front-end support to type traits


>> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]