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

Jean-Daniel Dupas devlists at shadowlab.org
Tue Apr 26 00:53:42 PDT 2011


Le 26 avr. 2011 à 01:02, Peter Collingbourne a écrit :

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

My bad, I missed it.
I moved it next to "static_assert", so it would be easier to find what C1X extensions are already declared here.

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

Of course, it would definitively be better to keep it consistent.

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


Here is a patch that simply add "static_assert" and declare it enabled unconditionally.


-- Jean-Daniel



-------------- next part --------------
A non-text attachment was scrubbed...
Name: c_features.patch
Type: application/octet-stream
Size: 947 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110426/dc713119/attachment.obj>


More information about the cfe-commits mailing list