Details
Details
- Reviewers
djasper klimek sammccall - Commits
- rG81b61a8291b5: Fix Bug 38713: clang-format mishandles a short block after "default:" in a…
rC341284: Fix Bug 38713: clang-format mishandles a short block after "default:" in a…
rL341284: Fix Bug 38713: clang-format mishandles a short block after "default:" in a…
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Thanks!
lib/Format/UnwrappedLineFormatter.cpp | ||
---|---|---|
486 ↗ | (On Diff #162646) | Just to check my understanding...
You could consider // default: in switch statement above this line. |
unittests/Format/FormatTest.cpp | ||
1012 ↗ | (On Diff #162646) | the intent of this test might be clearer if the cases were formatted as case 0: { return false; } on one line |
lib/Format/UnwrappedLineFormatter.cpp | ||
---|---|---|
486 ↗ | (On Diff #162646) | Exactly! |
unittests/Format/FormatTest.cpp | ||
1012 ↗ | (On Diff #162646) | I used the same test case that exposed this bug. Please see it in the bug report. Because of the bug, "case" and "default" case labels were handled differently. The former was correctly left alone, but the latter was merged into one line. Therefore, the test case checks that neither is merged. |