[cfe-dev] clang-format of switch

Daniel Jasper djasper at google.com
Wed Nov 5 02:18:41 PST 2014


This simply hasn't been considered for this brace style. If you keep the
braces on the same line, it does:

void func() {
   int i;
   switch(5) {
   case 0:
      i = 5;
   case 1: {
   }
   }
}

Which is in fact desired (a commonly used way to do this). Probably nobody
has looked at this for style that break before those braces.

On Wed, Nov 5, 2014 at 12:43 AM, Daniel Dilts <diltsman at gmail.com> wrote:

> I have code similar to the following:
>
> void func()
> {
>    int i;
>    switch(5)
>    {
>    case 0:
>       i = 5;
>    case 1:
>    {
>    }
>    }
> }
>
> I would expect the curly braces for case 1 to be indented from where they
> are, but they stay at the same indentation level as the label.  Is this the
> way this is supposed to be have, or is there some option (other than
> IndentCaseLabels) that controls this?
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141105/b38f06ec/attachment.html>


More information about the cfe-dev mailing list