This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Implementing p0515 - spaceship operator
- From: Marek Polacek <polacek at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Joseph Myers <joseph at codesourcery dot com>, David Brown <david at westcontrol dot com>, Jonathan Wakely <jwakely dot gcc at gmail dot com>, Tim van Deurzen <tim at kompiler dot org>, Jason Merrill <jason at redhat dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Thu, 30 Aug 2018 14:16:17 -0400
- Subject: Re: Implementing p0515 - spaceship operator
- References: <9cc3dc23-3c18-d05c-e5f4-f3d5dbeab075@kompiler.org> <CADzB+2mwgi4yaTJJf3NCZ9AC1AqYUEFMECj0g-smkmBLrjW4Yg@mail.gmail.com> <CAH6eHdSZce9rkrzxZ8iPQjw=gA=TLAOVRTLKTUQjAFqvohK1dg@mail.gmail.com> <CADzB+2kPkyha1wBgPtHXwxdu7T3_a+2TAhX6nYvbZGYmXZP_MA@mail.gmail.com> <53f18736-c429-bc29-bb34-3d61f52359ef@kompiler.org> <CAH6eHdSkssyVXoq3oDuRmNmPSW9JxZK_NJE6YcUCY+SQ+GbOKw@mail.gmail.com> <5A573705.4070406@westcontrol.com> <alpine.DEB.2.20.1801111357120.27821@digraph.polyomino.org.uk> <20180830180705.GN2218@tucnak>
On Thu, Aug 30, 2018 at 08:07:05PM +0200, Jakub Jelinek wrote:
> On Thu, Jan 11, 2018 at 02:06:06PM +0000, Joseph Myers wrote:
> > On Thu, 11 Jan 2018, David Brown wrote:
> >
> > > 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.
> >
> > As per previous IRC discussion, changing the lexing to support this
> > pp-token can break valid code in previous standards, e.g. code
> > concatenating <=> and >, then stringizing the result (the C++ proposal for
> > adding this feature also notes some obscure cases where the character
> > sequence <=> can actually occur as tokens, not just pp-tokens -
> > "X<&Y::operator<=>" and "x+&operator<=>y" - so of course patches adding
> > this feature should add testcases using such cases with older -std=
> > options).
> >
> > Changes to cpp_avoid_paste (so that preprocessed output does not put a
> > pp-token starting with > immediately after <=) do not need to be
> > conditional on the standard version, however.
>
> Here is a patch that attempts to implement this (in libcpp + gcc/testsuite
> only so far).
> It needs to be parsed and handled in the C++ FE obviously, which is missing.
Thanks.
Tim, have you had any success with this, or should I (or somebody else) feel
free to take it over?
Marek