[cfe-dev] [libcxx] RFC: C++14 and beyond
Howard Hinnant
hhinnant at apple.com
Tue May 7 10:53:15 PDT 2013
On May 2, 2013, at 1:51 PM, Marshall Clow <mclow.lists at gmail.com> wrote:
> How do you detect that a compilation was invoked with the "std=c++1y" flag?
> The traditional way of doing that is by inspecting the preprocessor define __cplusplus, but the value for that has not been determined for C++14.
>
> tot clang and gcc 4.8 both use "201103" for -std=c++11 and -std=c++1y
> [ I expect this will change by the time C++14 is adopted, but that's what it is today. ]
***** clang Feature Request ******
This is a problem. At the moment, there is *no* difference in *any* compiler-supplied macro between -std=c++11 and -std=c++1y. We don't have to use __cplusplus to key on, but it would be nice to somehow detect the difference between -std=c++11 and -std=c++1y.
On May 2, 2013, at 2:29 PM, Jonathan Sauer <jonathan.sauer at gmx.de> wrote:
> As far as clang is concerned this could be handled by __has_feature, e.g. __has_feature(cpp1y).
> (or some other identifier that doesn't have the "ell" vs "one" disambiguation problem.)
Which would be fine. But if it is there on tot today, I don't know how to spell it.
***** clang Feature Request ******
Howard
More information about the cfe-dev
mailing list