[cfe-dev] [libcxx] RFC: C++14 and beyond

Howard Hinnant hhinnant at apple.com
Tue May 7 11:37:11 PDT 2013

So I'm thinking along these lines in <__config>, below where platforms customize things:

#  if  1 // -std=c++98/03/11
#    define _LIBCPP_STD_VER 11
#  elif 0 // -std=c++1y/14
#    define _LIBCPP_STD_VER 13  // current year, or date of std ratification
#  elif 0 // -std=c++17
   // ...
#  endif
#endif  // _LIBCPP_STD_VER

I can't make this work today because I can't tell the difference between -std=c++98/03/11 and -std=c++1y/14.

If the client (or platform) desires, they can #define _LIBCPP_STD_VER and to whatever they want and <__config> will respect their definition.

libcxx implementors can:

#if _LIBCPP_STD_VER > 11

// implement a post C++11 feature


The clang driver could be taught how to set _LIBCPP_STD_VER.

Thoughts?  Help on telling the difference between -std=c++98/03/11 and -std=c++1y/14?


More information about the cfe-dev mailing list