This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] [PR462254] fix indentation of default and break correctly in whitesmiths style
ClosedPublic

Authored by MyDeveloperDay on Jun 17 2020, 7:54 AM.

Details

Summary

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

In ‘clang-format’, when using "BreakBeforeBraces: Whitesmiths".
In a ‘switch’ block, the ‘default’ case is always missing and indentation level. See below.

switch(x)
   {
   case 0:
      {
      foo(x + 1);
      }
   break;

   case 1:
      {
      goo(x % 42);
      }
   break;

default:
      {
      printf("the default case");
      }
   break;
   }

Diff Detail