[cfe-dev] The state of clang type traits

Howard Hinnant hhinnant at apple.com
Mon May 9 12:27:26 PDT 2011


Good work has been done on the clang type traits since the last time I did a survey.  I wanted to re-do the survey based on the good clang documentation at:

http://clang.llvm.org/docs/LanguageExtensions.html#checking_type_traits

I've put the updated results here:

http://libcxx.llvm.org/type_traits_design.html

The big needs are shown in the boxes with the red background.  The "nothrow" traits are especially needed in light of the recent work done for noexcept.  From the client's point of view, the only behavior change a noexcept spec gives to a member function is whether or not the associated is_nothrow_ trait returns true or not.  We currently can not detect nothrow destructors, nothrow constructors other than the default and copy constructors, nor nothrow assignment operators other than the copy assignment operator.

Three of the traits I can do in the library if CWG 1170 is implemented:

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1170

This is the one where access checks should be done as part of the substitution process.  However I'd be happier with compiler type traits for those three.

Howard




More information about the cfe-dev mailing list