[llvm-bugs] [Bug 39291] New: clang-format else block wierd CR

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Oct 15 02:27:30 PDT 2018


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

            Bug ID: 39291
           Summary: clang-format else block wierd CR
           Product: clang
           Version: 6.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: github at dlyr.fr
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

Hi, 
I'm not sure if it's the right place to post this, but I got strange behavior
regarding else block with curly braces.
Here are the config and results, the first two looks odd to me (inconsistent
format for if and else I would expect a newline before closing brace) or maybe
I miss something ( debian buster clang-format version 6.0.1-9
(tags/RELEASE_601/final) )
I got other kind of odd formating with allow 

---
BasedOnStyle: LLVM
BreakBeforeBraces: Custom
BraceWrapping:
  BeforeElse: true
  AfterControlStatement: true
...
if (test)
{
  foo();
}
else
{ bar(); }


---
BasedOnStyle: LLVM
BreakBeforeBraces: Custom
BraceWrapping:
  BeforeElse: false
  AfterControlStatement: true
...
if (test)
{
  foo();
} else
{ bar(); }


---
BasedOnStyle: LLVM
BreakBeforeBraces: Custom
BraceWrapping:
  BeforeElse: true
  AfterControlStatement: false
...
if (test) {
  foo();
}
else {
  bar();
}


---
BasedOnStyle: LLVM
BreakBeforeBraces: Custom
BraceWrapping:
  BeforeElse: false
  AfterControlStatement: false
...
if (test) {
  foo();
} else {
  bar();
}


++ d

-- 
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/20181015/2197ab8f/attachment.html>


More information about the llvm-bugs mailing list