bug#72695: CC Mode 5.35.2 (C++//l); c++-mode misindents 'if constexpr' inside lambdas
Arsen Arsenović via CC-Mode-help <[email protected]> Sat, 28 Sep 2024 01:24:52 +0200
| Newsgroups | gmane.emacs.cc-mode.general |
|---|---|
| Message-ID | <[email protected]> |
--===============7481937121903399330== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Alan, Alan Mackenzie <[email protected]> writes: > So, can I close bug#72695 now? Ah, excuse me. Yes, I do believe so. >> I'm not sure this is a bug but it is something I noticed by accident: > >> (std::visit >> ([] <typename T> >> (const T& data) >> { >> })); > >> ... the { is not an inline-open, but an arglist-cont-nonempty (though, >> to be clear, the body is indented okay; I've elided it from the example >> above for that reason). > > That is a bug, yes, but a different bug. Could I ask you to raise a new > Emacs bug report for it, please? I can do so tomorrow - getting drowsy at this point. > I think it will require some effort to solve, since it involves "function > type" constructs inside parentheses, which I think was something new to > CC Mode with C++20 (but I'm not sure). Rather than just relying on the > context of the outer (, c-guess-basic-syntax will have to examine the > contents of (...) to get better analysis. Hmm, I think this was here in 11 also (and perhaps before, due to the GNU statement expression extension). >> Same goes for the (const T& data), which doesn't get indented the same >> as a 'standalone' lambda, but it does indent the same as one saved into >> a variable: > >> [] >> () >> { >> }; >> auto x =3D >> [] >> () >> { >> }; >> auto x =3D >> ([] >> () >> { >> }); > >> I do not know whether this is correct. > > Neither do I, this late at night. ;-) I'll have a look at all these > examples tomorrow. :-) Thanks. I will file a bug with these tomorrow. Have a lovely evening! =2D-=20 Arsen Arsenovi=C4=87 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iOYEARYKAI4WIQT+4rPRE/wAoxYtYGFSwpQwHqLEkwUCZvc+xF8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0RkVF MkIzRDExM0ZDMDBBMzE2MkQ2MDYxNTJDMjk0MzAxRUEyQzQ5MxAcYXJzZW5AYWFy c2VuLm1lAAoJEFLClDAeosST/u4A/2lr6kBsQ4u/nSdSE2l9SrhQU9eWcWFS6ilL eKzCMac6AQDTROf1OoY/6MHfR5K0z1ih7RZvo/dIcx0FS0mt8+irAQ== =BmwT -----END PGP SIGNATURE----- --=-=-=-- --===============7481937121903399330== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============7481937121903399330==--