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


Gabriel Dos Reis wrote:

I was hoping that we would not need to use C++ template syntax.  I was
hoping that the actual syntax should be C compatible

__trait__(T, __has_trivial_constructor__)

where the first argument is a type, and the second could be made an
enumeration (known to the compiler), or just identifiers à la
offsetof, or GNU C attributes; with __trait__ itself a built in
function as apposed to a keyword.


Ok, now I see. Actually I experimented already a bit with __builtin_offsetof. There is a small complication in that we want to keep open the possibility of binary traits, therefore:

__trait__(T, U, __is_base_of__)

I suppose tentative parsing has no problem with that, right?

Paolo.


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