[cfe-dev] auto and decltype availability

Michael Price michael.b.price.dev at gmail.com
Fri Jul 15 14:05:08 PDT 2011

I think that is a perfectly fine recommendation, but this isn't for writing
code.  This is for letting people know which version of the compiler first
introduced a certain feature.  For instance, if we want to use
static_assert, we may (depending on other feature availability) only want to
update to the version of clang that supported the features that we desire.

It's hard to convince managers that we should update (or even switch
compilers) if we have to respond with "use __has_feature in the code".

On Fri, Jul 15, 2011 at 1:38 PM, Chris Lattner <clattner at apple.com> wrote:

> On Jul 15, 2011, at 9:11 AM, Michael Price wrote:
> > Does anyone know which released version first had the auto and decltype
> features 'turned on'? And generally speaking, is there an easy way to
> determine this for any given C++0x feature?
> >
> > For some background, I'm working on a series of C++0x presentations at
> the company I work for, and at the end of every presentation I have a chart
> that shows the availability of the features I discussed that day.  Currently
> we are not using clang, but I have an entry for it because I want to show
> that clang is trying to keeping pace with GCC and surpassing IBM XL C/C++
> and Sun Studio.
> Hi Michael,
> We recommend that people write code that uses __has_feature to check for a
> feature, not compare against a compiler version number.  These are
> documented here:
> http://clang.llvm.org/docs/LanguageExtensions.html#feature_check
> -Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110715/b21d9765/attachment.html>

More information about the cfe-dev mailing list