[PATCH] D133571: [clang-format] Introduce NoFallThrough option into AllowShortCaseLabelsOnASingleLine

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 12 13:23:32 PDT 2022


HazardyKnusperkeks added inline comments.


================
Comment at: clang/include/clang/Format/Format.h:469
+  /// Different styles for merging short case labels.
+  enum ShortCaseLabelStyle : int8_t {
+    /// Never merge case code
----------------
MyDeveloperDay wrote:
> HazardyKnusperkeks wrote:
> > While we're at it, shouldn't there be a `Leave`? ;)
> I think Leave is Never
No. `Leave` would leave me with this:
```
switch (a) {
  case 1: x = 1; break;
  case 2:
    return;
}
```
If I'd start with it. `Leave` allows to mix the Yes and No options.


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

https://reviews.llvm.org/D133571



More information about the cfe-commits mailing list