Subject: Re: bug#72695: CC Mode 5.35.2 (C++//l); c++-mode misindents 'if constexpr' inside lambdas

From: Arsen Arsenović <[email-masked]>
Date: Sat, 31 Aug 2024 02:54:01 +0200

Hello, Alan,

Alan Mackenzie <[email-masked]> writes:

> Hello, Arsen.
>
> A short progress report.
>
> On Wed, Aug 21, 2024 at 22:40:02 +0200, Arsen Arsenović wrote:
>> Hello Alan,
>
>> Alan Mackenzie <[email-masked]> writes:
>> > Thanks for the bug report!
>
>> My pleasure.  Thanks for being as fast as always.
>
> I apologise for not having been as fast over the last few days.  Partly,
> I'm bringing up a new computer, which never goes as fast as one would
> like.

No worries, of course!  Hope the setup went well.

> But mainly I'm struggling with the unfathomable complexity of C++ lambda
> functions, as documented on
> https://en.cppreference.com/w/cpp/language/lambda.

It should be quite simple - just a few optional productions preceded by
an introducer production (see https://eel.is/c++draft/expr.prim.lambda
for a formal grammar - this is the text from the standard draft).

> In my not so humble opinion, the C++ standards people have completely
> lost the plot.

Should help be necessary, I do work on G++ so I'm quite familiar with
the language.  Feel free to ping me.

> The number of special cases in just the syntax, apparently just to
> save a few characters from a program's text, has got beyond the point
> where anybody can grasp it.  Nobody in this group of people appears to
> be able to say "STOP!", though somebody sorely needs to.  I dread to
> think what will be coming out in C++26.  :-(

It really shouldn't be that bad - I'll help demystify if need be.

> Anyhow, I've spent all afternoon on the problem so far, and I think I can
> see my way to a solution.  It will still take a few more days yet, I'm
> afraid.

Thank you very much!  My apologies for the trouble.

Have a lovely day.
-- 
Arsen Arsenović