[cfe-commits] [PATCH] _has_feature support for new C1X features.

Peter Collingbourne peter at pcc.me.uk
Mon Apr 25 16:02:20 PDT 2011


On Mon, Apr 25, 2011 at 09:15:09PM +0200, Jean-Daniel Dupas wrote:
> As clang start to implements C1X, it may be useful to extend __has_feature to support the new implemented features.
> 
> Here is a patch that add 'c_static_assert' and 'c_generic_selection', and a test case similar to the one used for c++0x.
> 
> This patch adds 'c_generic_selection', but I don't know the status of this feature. If it is not ready yet, this part should be commented.

Hi Jean-Daniel,

We already have __has_feature(generic_selections).

Prefixing C features with c_ is unprecedented (and it would of course
be a bad idea to rename the existing C features/extensions) so I think
that for the sake of consistency the C1X static assert feature should
just be called "static_assert".

Also, C1X static assertions are supported as an extension in all
languages so the feature should not be predicated on the C1X language
option.

Thanks,
-- 
Peter



More information about the cfe-commits mailing list