[llvm-bugs] [Bug 41752] New: AllowShortLoopsOnASingleLine does not work on trivial loops

via llvm-bugs llvm-bugs at lists.llvm.org
Sun May 5 06:34:58 PDT 2019


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

            Bug ID: 41752
           Summary: AllowShortLoopsOnASingleLine does not work on trivial
                    loops
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: shodan at shodan.ru
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

.clang-format contents:

Language: Cpp
BasedOnStyle: LLVM
BreakBeforeBraces: Allman
AllowShortLoopsOnASingleLine: true

Input file:

void Foo()
{
  while (*p++);
}

Expected output: same as input.

Actual output: semicolon gets detached.

void Foo()
{
  while (*p++)
    ;
}

-- 
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/20190505/5f444431/attachment.html>


More information about the llvm-bugs mailing list