For what it's worth, I strongly suggest that you only define those when 
__cpluplus is pre-C++11.

There is simply too much software out there which will run into this
and being aggressive in breaking (admittedly non-standard confirming
programs) gives GCC a bad reputation and is not nice to our users to
begin with.

Gerald

On Mon, 9 Jan 2012, Jonathan Wakely wrote:
> I've just seen Richard's status email, so I guess this should wait for 4.8
> 
> 
> On 9 January 2012 08:48, Jonathan Wakely wrote:
>> GCC's implementation of <stdbool.h> is not valid for C++11 because
>> [support.runtime] p8 says "The header <cstdbool> and the header
>> <stdbool.h> shall not define macros named bool, true, or false."
>>
>> This patch adds a libstdc++ test for that requirement and adjusts
>> stdbool.h to meet it.  I've left _Bool defined in C++ as a GNU
>> extension.
>>
>> It's conceivable someone is relying on these macros being defined in
>> C++, in which case we could only define them when __cplusplus <
>> 201103L, but IMHO it's better to not define them at all.
>>
>> Tested x86_64-linux, OK for trunk?
>>
>> gcc/
>>        * ginclude/stdbool.h (true, false, bool): Do not define for C++.
>>
>> libstdc++/
>>        * testsuite/18_support/headers/cstdbool/macros.cc: New.

Reply via email to