[cfe-dev] [libcxx] using has_extension instead of has_feature

Sean Hunt scshunt at csclub.uwaterloo.ca
Fri Aug 12 08:24:45 PDT 2011


On Fri, Aug 12, 2011 at 02:25, Jean-Daniel Dupas <devlists at shadowlab.org> wrote:
> Hello,
>
> I'd like to propose to use __has_extension instead of __has_feature to detect available features in libc++ headers.
>
> Using __has_feature prevent usage of functionalities provided by clang as extension when compiling in older standard mode.
>
> As __has_extension is a superset of __has_feature, it should not have any effect on people using the library in c++0x mode.
>
> And when using -pedantic, __has_extension have the same behavior than __has_feature, so it is always be possible to disable extensions if needed.
>
> Path to perform this change (if accepted) attached.
>
> Thanks
>
> -- Jean-Daniel

Have you tested this thoroughly? While I think this is a good idea, my
experience with it has been that the code doesn't work with certain
combinations of features in a number of places. Not to say that these
aren't bugs (they are), but that we should make sure they are fixed
before we go about making changes to the feature structure.

Sean



More information about the cfe-dev mailing list