[llvm-bugs] [Bug 48256] New: clang-format Allman brace style joins } with while keyword in do/while loop

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Nov 21 18:29:14 PST 2020


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

            Bug ID: 48256
           Summary: clang-format Allman brace style joins } with while
                    keyword in do/while loop
           Product: clang
           Version: 11.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: legalize at xmission.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

Created attachment 24197
  --> https://bugs.llvm.org/attachment.cgi?id=24197&action=edit
.clang-format

A do/while loop in Allman brace style should be written like this:

do
{
    loopBody();
}
while (cond);

clang-format joins the brace and the while line, giving this:

} while (cond);

This isn't Allman brace style, which has every opening and closing brace
on it's own line at the same indent level as the enclosing scope of the
control statement.

-- 
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/20201122/95fca295/attachment.html>


More information about the llvm-bugs mailing list