Add the latest C++ SD-6 additions.

Ed Smith-Rowland 3dw4rd@verizon.net
Tue Nov 11 05:58:00 GMT 2014


On 11/10/2014 12:10 PM, Jason Merrill wrote:
> On 11/10/2014 10:55 AM, Ed Smith-Rowland wrote:
>> Would a 4.9 version be accepted?
>
> Sure.
>
> What do you think about defining the macros for unsupported features 
> to 0 rather than leaving them undefined?  The document doesn't seem to 
> specify.
>
> Jason
>
>
Jason,

1. Undefined macros evaluate to 0 so that's effectively what we have now 
- no change in behavior if we explicitly set them
2. The SD-6 document "advertises" direct use of macros with #if 
__cpp_foobar without #ifdef - However if people are using #ifdef rather 
than #if that might break things (I guess that's different behavior); 
OTOH those dates are there for a reason.
3. OTOH, the SD-6 document seems to suggest only adding a macro as a 
feature is implemented or allowed bycompiler flags - implying undefined 
macros for unimplemented features
4. __has_include and __has_cpp_attribute return 0 on 
non-existent/undefined so there's some precedent (though these are 
rather different structurally - function macros)

So I'm conflicted after being initially sympathetic to defining as 
zero.  Still slightly in favor.

I'll might put this to the SD-6 list because it would be nice to have 
clarity - even if it's "implementation defined".

Ed



More information about the Gcc-patches mailing list