[llvm-bugs] [Bug 38926] New: Short case label followed by a block is not formatted correctly

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 13 03:13:55 PDT 2018


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

            Bug ID: 38926
           Summary: Short case label followed by a block is not formatted
                    correctly
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: owenpiano at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

With configuration file:

BasedOnStyle: LLVM
AllowShortCaseLabelsOnASingleLine: true
IndentCaseLabels: true
BreakBeforeBraces: Custom
BraceWrapping:
  AfterControlStatement: true

The following code:

switch (n) {
  case 0: {
    return false;
  }
  default: {
    return true;
  }
}

is incorrectly formatted to:

switch (n)
{
  case 0: { return false;
  }
  default: { return true;
  }
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180913/e9463a15/attachment-0001.html>


More information about the llvm-bugs mailing list