[PATCH] D140339: [clang-format] Remove special logic for parsing concept definitions.

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 20 06:29:00 PST 2022


HazardyKnusperkeks accepted this revision.
HazardyKnusperkeks added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/lib/Format/TokenAnnotator.cpp:1683
 
-        if (Tok->isOneOf(tok::kw_class, tok::kw_enum, tok::kw_concept,
-                         tok::kw_struct, tok::kw_using)) {
+        if (Tok->isOneOf(tok::kw_class, tok::kw_enum, tok::kw_struct,
+                         tok::kw_using)) {
----------------
rymiel wrote:
> HazardyKnusperkeks wrote:
> > Does this change anything, besides the penalties and by that the wrapping?
> > 
> > While I can live with both, I think we should not format code differently, if it's not by a bugfix.
> The only changes I could see:
>  - the change in `Context.IsExpression`, which causes the change in penalties;
>  - the fact that a new `AnnotatedLine` isn't created for the body of a `concept` (i.e. the stuff after the equals sign), where as it previously was.
>  - some invalid syntax is formatted differently
> 
> It's very likely I don't have a "sample size" large enough.
> 
> I am also okay with doing both; I made this issue to gauge what is the preferred direction by the reviewers.
Let's hear from @owenpan @MyDeveloperDay 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140339/new/

https://reviews.llvm.org/D140339



More information about the cfe-commits mailing list