[cfe-dev] Libc++ Windows Semi-analyzed test results
Douglas Gregor
dgregor at apple.com
Wed Sep 28 16:39:02 PDT 2011
On Sep 28, 2011, at 4:28 PM, Christopher Jefferson wrote:
>
> On 28 Sep 2011, at 21:00, Marc Glisse wrote:
>
>> On Wed, 28 Sep 2011, Howard Hinnant wrote:
>>
>>> #include <iostream>
>>>
>>> int main()
>>> {
>>> std::cout << __cplusplus << '\n';
>>> }
>>>
>>> Without -std=c++0x:
>>>
>>> 1
>>>
>>> With -std=c++0x:
>>>
>>> 201103
>>
>> NOOOOOOOO!!!
>> :-(
>>
>> What is the rational for defining it before the C++11 support is (almost)
>> complete? The main point of the value of this macro is imho to be able to
>> detect whether we can use C++11 features. If you want to indicate
>> experimental partial support, a compiler specific macro is fine. But
>> defining __cplusplus to 201103 when the new standard isn't implemented yet
>> makes the macro useless. The only rational I could think of is that the
>> C++11 mode of clang is considered experimental and unsupported and thus it
>> doesn't matter that it doesn't work…
>
> Well, given that the C++03 support isn't finished, and probably never will be, we should probably remove the c++98 definition too ;)
>
> In practice the C++0x support is in a good state, I know a number of people (including myself) who are using it on a day-to-day basis, and I suspect it will be years, if ever, before the compiler is 100% standards compliant.
… and other compilers that don't have complete C++11 support (= all of them) are also defining __cplusplus to 201103, so you can't actually depend on 201103 to mean "everything in C++11" in portable code anyway.
- Doug
More information about the cfe-dev
mailing list