Implementing p0515 - spaceship operator
David Brown
david@westcontrol.com
Thu Jan 11 10:06:00 GMT 2018
On 10/01/18 14:00, Jonathan Wakely wrote:
> On 9 Jan 2018 10:56 p.m., "Tim van Deurzen" <tim@kompiler.org>wrote:
>
>
> Just to confirm with you, it does make sense to conditionally parse the
> token for operator<=> in libcpp (i.e. only when the cxx standard being used
> is >=2a)? I'm just wondering if this does not accidentally affect other
> front-ends using libcpp?
>
Maybe it is easier to say "gcc supports <=> in C++2a, and as an
extension also supports it in C and C++ of any standard" ? I don't
believe there is any way for it to conflict with existing valid code, so
it would do no harm as a gcc extension like that - and C users can then
use it too.
>
> Other front ends won't setthe language to C++2a.
>
> I think the relevant check is:
>
> if (CPP_OPTION (pfile, lang) == CLK_CXX2A
> || CPP_OPTION (pfile, lang) == CLK_GNUCXX2A)
>
> This can only be true for a C++ source file when the standard is C++2a.
>
More information about the Gcc
mailing list