[llvm-bugs] [Bug 38557] New: comments between "default" and ':' causes the case label to be treated as an identifier

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Aug 14 03:10:45 PDT 2018


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

            Bug ID: 38557
           Summary: comments between "default" and ':' causes the case
                    label to be treated as an identifier
           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

Created attachment 20707
  --> https://bugs.llvm.org/attachment.cgi?id=20707&action=edit
test case

Command line:
clang-format -style="{IndentCaseLabels: true}" foo.cpp

Output with an incorrect indentation for the default case label:
bool foo(int n) {
  switch (n) {
  default /*comments*/:
      return true;
    case 0:
      return false;
  }
}

Expected output:
bool foo(int n) {
  switch (n) {
    default /*comments*/:
      return true;
    case 0:
      return false;
  }
}

-- 
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/20180814/0f19ee36/attachment.html>


More information about the llvm-bugs mailing list