This revision was automatically updated to reflect the committed changes.
Closed by commit rL309370: clang-format: merge short case labels with trailing
comments (authored by Typz).
Repository:
rL LLVM
https://reviews.llvm.org/D35557
Files:
cfe/trunk/lib/Format/UnwrappedLineFormatter.cpp
krasimir accepted this revision.
krasimir added a comment.
This revision is now accepted and ready to land.
Looks good! Thanks!
https://reviews.llvm.org/D35557
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mai
Typz updated this revision to Diff 107841.
Typz marked 4 inline comments as done.
Typz added a comment.
Address review comments
https://reviews.llvm.org/D35557
Files:
lib/Format/UnwrappedLineFormatter.cpp
unittests/Format/FormatTest.cpp
Index: unittests/Format/FormatTest.cpp
==
Typz added inline comments.
Comment at: unittests/Format/FormatTest.cpp:912
+ " break;\n"
+ "}",
+ Style);
krasimir wrote:
> I'd suggest adding more cases here, like:
> ```
>"case 6: /* comment */ x = 1;
krasimir added inline comments.
Comment at: lib/Format/UnwrappedLineFormatter.cpp:405
+for (; J != E; ++J) {
+ const AnnotatedLine *Line = J[0];
+ if (Line->InPPDirective != InPPDirective)
I'd change `J[0]` to `*J` and rename `Line` to s
Typz created this revision.
Herald added a subscriber: klimek.
Allow merging short case labels when they actually end with a comment
(like a comment after the ``break``) and when followed by switch-level
comments (e.g. aligned with next case):
switch(a) {
case 0: break; // comment at end of c