[cfe-dev] auto and decltype availability

Douglas Gregor dgregor at apple.com
Sat Jul 16 22:13:30 PDT 2011


On Jul 16, 2011, at 3:19 AM, Richard Smith wrote:

> On Sat, July 16, 2011 10:54, Jean-Daniel Dupas wrote:
>> Le 16 juil. 2011 à 03:42, Craig Silverstein a écrit :
>>> } What is the release version number(s) of the LLVM project that first
>>> } included a clang frontend that linked in a version of libclang that
>>> } was able to correctly (according to a reasonably recent draft of the
>>> } C++0x standard) handle the 'auto' and 'decltype' keywords?
>>> 
>>> 
>>> In my limited experience, llvm releases are pretty far apart.  You may
>>> be better served by just saying the date that the completed functionality
>>> was submitted to top-of-tree clang.
>>> 
>>> How I would do it (caveat: I'm no expert on clang nor llvm), would be
>>> to look for commits that updated http://clang.llvm.org/cxx_status.html.
>>> One way to do that would be here:
>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/www/cxx_status.html?view=l
>>> og
>> 
>> 
>> You suggestion make me think about an other file that let you know the
>> exact revision that enabled a c++0x feature.
>> 
>> clang/test/Lexer/has_feature_cxx0x.cpp
>> 
>> This is the test files which test the __has_feature() macro for each
>> c++0x feature.
>> 
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/has_feature_cxx0
>> x.cpp?view=log
>> 
>> For instance, auto_type was enabled in commit  r126078
> 
> The 'auto' type specifier became available in version 2.9. Some
> auto-related issues were fixed in r126166, and cxx_status.html was updated
> in r128787 in preparation for the 2.9 release.
> 
> Full support for 'decltype' in the type of a function template required
> tracking instantiation dependence, which we did not yet do in version 2.9.
> However, 'decltype' in other contexts was working in 2.9 (and quite
> possibly in several earlier releases).


Thank you, Richard. For (almost) all practical purposes, auto and decltype were in LLVM/Clang 2.9. Instantiation dependence only affects name mangling at this point.

The meta-point here is that we should certainly track this better. GCC's C++0x status page shows which GCC version introduced each C++0x feature. We should do the same (for llvm.org's releases; vendors can communicate with their customers through their own channels).

	- Doug



More information about the cfe-dev mailing list