[PATCH] D145642: [clang-format] Annotate lambdas with requires clauses.

2023-03-25 Thread Emilia Dreamer via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG5409fb38372d: [clang-format] Annotate lambdas with requires clauses. (authored by rymiel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D145642: [clang-format] Annotate lambdas with requires clauses.

2023-03-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. @rymiel I'm deferring to you and @HazardyKnusperkeks, so doing nothing for now is fine. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145642/new/ https://reviews.llvm.org/D145642 __

[PATCH] D145642: [clang-format] Annotate lambdas with requires clauses.

2023-03-23 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks accepted this revision. HazardyKnusperkeks added a comment. I think this is okay. A followup could handle single line lambdas. But I have a personal struggle with them, especially the name `AllowShortLambdasOnASingleLine` no it is not //allow// if turned on it is //force//. A

[PATCH] D145642: [clang-format] Annotate lambdas with requires clauses.

2023-03-23 Thread Emilia Dreamer via Phabricator via cfe-commits
rymiel added a comment. So, it took me a while but I finally found where the logic is that makes the lambda braces stay on one line, but, now I'm not so sure if I should change it: The thing I wanted to avoid was cases like [&](T&& t) requires T { t; }; Simply because "those braces don't

[PATCH] D145642: [clang-format] Annotate lambdas with requires clauses.

2023-03-22 Thread Emilia Dreamer via Phabricator via cfe-commits
rymiel marked an inline comment as done. rymiel added inline comments. Comment at: clang/unittests/Format/TokenAnnotatorTest.cpp:1352 + + // Both at once? Probably not even valid. + Tokens = annotate("[] requires Foo (T t) requires Bar {}"); usaxena95 wrote:

[PATCH] D145642: [clang-format] Annotate lambdas with requires clauses.

2023-03-22 Thread Emilia Dreamer via Phabricator via cfe-commits
rymiel added a comment. In D145642#4213256 , @usaxena95 wrote: > Another point: > While testing this patch, the following still fails to recognise. Might be > something special with `true`. > > auto y = [&] > requires true(Callable && callable) >

[PATCH] D145642: [clang-format] Annotate lambdas with requires clauses.

2023-03-22 Thread Emilia Dreamer via Phabricator via cfe-commits
rymiel updated this revision to Diff 507440. rymiel added a comment. Remove unnecessary musing Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145642/new/ https://reviews.llvm.org/D145642 Files: clang/lib/Format/UnwrappedLineParser.cpp clang/uni

[PATCH] D145642: [clang-format] Annotate lambdas with requires clauses.

2023-03-22 Thread Emilia Dreamer via Phabricator via cfe-commits
rymiel updated this revision to Diff 507439. rymiel added a comment. Fix `true` edge case Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145642/new/ https://reviews.llvm.org/D145642 Files: clang/lib/Format/UnwrappedLineParser.cpp clang/unittest

[PATCH] D145642: [clang-format] Annotate lambdas with requires clauses.

2023-03-22 Thread Utkarsh Saxena via Phabricator via cfe-commits
usaxena95 added a comment. > starting a line with an opening paren is pretty weird!) I do not think this is weird. On the contrary, this is more readable to me and separates the requires clause from the parameters list. For example this one looks so much better: // trunk. template void

[PATCH] D145642: [clang-format] Annotate lambdas with requires clauses.

2023-03-11 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D145642#4186462 , @rymiel wrote: > Could you please clarify what you mean by "regressions" here? Isn't the > behaviour of this syntax broken to begin with? It doesn't change anything > about lambdas without //requires-clause/

[PATCH] D145642: [clang-format] Annotate lambdas with requires clauses.

2023-03-10 Thread Emilia Dreamer via Phabricator via cfe-commits
rymiel added a comment. Could you please clarify what you mean by "regressions" here? Isn't the behaviour of this syntax broken to begin with? It doesn't change anything about lambdas without //requires-clause//s Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

[PATCH] D145642: [clang-format] Annotate lambdas with requires clauses.

2023-03-10 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D145642#4186304 , @rymiel wrote: > In D145642#4183539 , @owenpan wrote: > >> Would this patch make the end result look worse without "making the requires >> clause formatting of lambda

[PATCH] D145642: [clang-format] Annotate lambdas with requires clauses.

2023-03-10 Thread Emilia Dreamer via Phabricator via cfe-commits
rymiel added a comment. In D145642#4183539 , @owenpan wrote: > Would this patch make the end result look worse without "making the requires > clause formatting of lambdas > match the formatting for functions"? If yes, then we should not land it just > y

[PATCH] D145642: [clang-format] Annotate lambdas with requires clauses.

2023-03-09 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Would this patch make the end result look worse without "making the requires clause formatting of lambdas match the formatting for functions"? If yes, then we should not land it just yet. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

[PATCH] D145642: [clang-format] Annotate lambdas with requires clauses.

2023-03-09 Thread Emilia Dreamer via Phabricator via cfe-commits
rymiel marked an inline comment as done. rymiel added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:3393 +break; + } else { +return; HazardyKnusperkeks wrote: > don't need `else` after `break`. > In fact I would negate

[PATCH] D145642: [clang-format] Annotate lambdas with requires clauses.

2023-03-09 Thread Emilia Dreamer via Phabricator via cfe-commits
rymiel updated this revision to Diff 503753. rymiel added a comment. Improve code flow in parseConstraintExpression Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145642/new/ https://reviews.llvm.org/D145642 Files: clang/lib/Format/UnwrappedLineP

[PATCH] D145642: [clang-format] Annotate lambdas with requires clauses.

2023-03-09 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks accepted this revision. HazardyKnusperkeks added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:3393 +break; + } else { +return; don't need `else` afte

[PATCH] D145642: [clang-format] Annotate lambdas with requires clauses.

2023-03-08 Thread Emilia Dreamer via Phabricator via cfe-commits
rymiel created this revision. rymiel added a project: clang-format. rymiel added reviewers: HazardyKnusperkeks, MyDeveloperDay, owenpan. Herald added a project: All. rymiel requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The C++ grammar all