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

From: Alan Mackenzie <[email-masked]>
Date: Fri, 27 Sep 2024 14:13:14 +0000

Hello, Arsen.

On Thu, Sep 26, 2024 at 22:14:28 +0200, Arsen Arsenović wrote:
> Hi Alan,

[ .... ]

> > ..... My reading of that lambda-expression derivation is that the
> > "alignas (128)" is the atribute-specifier-seq_opt, and the "requires
> > some_concept<T>" is the requires-clause_opt.  Surely the first of
> > these, the "alignas" needs to come after the second, the "requires"?

> > Phew!

> Yes!  You're completely right, I accidentally "combined" the two cases
> of lambda-expression while writing that example.  Forgive me.

> (serves me right for bug-reporting late.. ;-) )

I'm glad we agree on this point.  :-)

[ .... ]

> > I'm hoping to get the patch committed before the weekend.

> Yay!  :-)

I've now committed a slightly different patch, after noticing and fixing
another bug.

The bug was that in code like

1 template <typename T>
2 requires requires (T x)
3 { x + x; }
4 T add(T a, T b)
5 {
6    return a + b;
7 }

, L4, a topmost-intro-cont used to be anchored on the previous
topmost-intro-cont line, L2, whereas it should be anchored on the
topmost-intro, L1.

I've now corrected this.

I didn't send you yet another patch with request for testing, because
I've done that rather a lot of late, and I'm confident about the patch.

I haven't yet closed the bug, just in case you wanted to do some final,
final testing on the committed version.  Please let me know what you feel
about that, so that I can finally close this bug.

Just as a matter of interest, one or two other bugs reared their heads,
but I'm fixing these separately in the next few days.

> Thank you very much!

Thank you again.

> Have a lovely night.
> -- 
> Arsen Arsenović

-- 
Alan Mackenzie (Nuremberg, Germany).