On 09/15/2017 01:53 PM, Jakub Jelinek wrote:
> On Mon, Aug 07, 2017 at 02:17:17PM +0100, Pedro Alves wrote:
>> I happened to skim this patch and notice a couple issues.
>> See below.
>
> Note I've just posted updated patch based on this to gcc-patches.
Thanks ( FWIW :-) ).
>>> @@ -497,7 +499,10 @@ cpp_init_builtins (cpp_reader *pfile, int hosted)
>>>
>>> if (CPP_OPTION (pfile, cplusplus))
>>> {
>>> - if (CPP_OPTION (pfile, lang) == CLK_CXX1Z
>>> + if (CPP_OPTION (pfile, lang) == CLK_CXX2A
>>> + || CPP_OPTION (pfile, lang) == CLK_GNUCXX2A)
>>> + _cpp_define_builtin (pfile, "__cplusplus 201707L");
>>
>> I think you wanted 202007L here.
>
> The documentation states some unspecified value strictly greater than
> 201703L. In the patch I've posted it is 201709L, because that is this
> month, 202007L would be just a wild guess. People aren't supposed to
> rely on a particular value until C++2z is finalized, so just use
> (__cplusplus > 201703L) for features beyond C++17.
>
I see, I had assumed 202007L was the intention because that's
what was in the changeLog entry, and because "2020":
Add support for C++2a.
* include/cpplib.h (c_lang): Add CXX2A and GNUCXX2A.
* init.c (lang_defaults): Add rows for CXX2A and GNUCXX2A.
(cpp_init_builtins): Set __cplusplus to 202007L for C++2x.
^^^^^^
Thanks,
Pedro Alves