[cfe-dev] Libc++ Windows Semi-analyzed test results

Miles Bader miles at gnu.org
Wed Sep 28 11:02:15 PDT 2011


Ruben Van Boxem <vanboxem.ruben at gmail.com>
writes:
> >    std::cout << __cplusplus << '\n';
> >
> > Without -std=c++0x:
> > 1
> > With -std=c++0x:
> > 201103
>
> Doh! Could've done that myself. Good to know Clang does it right at least,
> even though the support is still incomplete. <evil look at the GCC
> developers>

Note that the issues behind __cplusplus being "1" in gcc finally seem
to have been resolved (my vague understanding is that it had something
to do with system include files in Solaris!).  The gcc trunk now
always uses a value of 199711 for __cplusplus.

It'll be quite a while before the value of __cplusplus is a reliable
indicator of c++11 features being available though (as demonstrated by
clang's setting!), so code probably shouldn't be using it to test for
them [unless it's intimately related to a particular compiler
distribution, and so can make detailed assumptions about what the
value implies]...

-miles

-- 
Love is the difficult realization that something other than oneself is real.
[Iris Murdoch]




More information about the cfe-dev mailing list