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

            Bug ID: 41086
           Summary: Block after case/default label is unindented one level
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangb...@nondot.org
          Reporter: andy...@mail.ru
                CC: djas...@google.com, kli...@google.com,
                    llvm-bugs@lists.llvm.org

For some reason clang-format unindents code blocks after `case` or `default`
labels one level, and there seems to be no way to configure that. My desired
formatting style is like this:

```
switch (i)
{
case 1:
    x = 10;
    break;

case 2:
    {
        x = 20;
    }
    break;
}
```

In other words, I need `case`/`default` labels to be unindented one level and
the code after the labels to be indented one level, whether or not that code
includes a code block.

In practice the second `case` gets always unindented like this:

```
switch (i)
{
case 1:
    x = 10;
    break;

case 2:
{
    x = 20;
}
break;
}
```

Please, add an option to fix this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to