[clang-format] PR48569 clang-format fails to align case label with `switch` with...
authormydeveloperday <mydeveloperday@gmail.com>
Sat, 26 Dec 2020 15:18:14 +0000 (15:18 +0000)
committermydeveloperday <mydeveloperday@gmail.com>
Sat, 26 Dec 2020 15:19:03 +0000 (15:19 +0000)
commitc7dcc4c72588db9ffb7ae379983450193b943f5b
treea2aeb47c509b5e49f4621d30b2c577dc97b5169f
parentb21840751278128ef6942074ae89ea63c9c6ac58
[clang-format] PR48569 clang-format fails to align case label with `switch` with Whitesmith Indentation

https://bugs.llvm.org/show_bug.cgi?id=48569

This is a tentative fix which addresses a PR raise regarding Case indentation when working with Whitesmiths Indentation

I could not find online any reference sources as to what the case indentation for Whitesmith's should be (or be allowed to be)

But according to the documentation, we don't obey the rules for Whitesmith's

```
In particular, the documentation states that this option is to "indent case labels one level from the switch statement. When false, use the same indentation level as for the switch statement."
```

The behaviour we add here is actually as the TODO in the tests used to state in {D67627}, but when {D82016} was added and I brought these tests out from being TODO I realized I changed the indentation.

Reviewed By: curdeius, HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D93806
clang/lib/Format/UnwrappedLineParser.cpp
clang/unittests/Format/FormatTest.cpp