[llvm-bugs] [Bug 30304] New: Combination of BreakBeforeBinaryOperators: All, AlignAfterOpenBracket: AlwaysBreak doesn't handling long template parameter list.

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 6 21:23:54 PDT 2016


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

            Bug ID: 30304
           Summary: Combination of BreakBeforeBinaryOperators: All,
                    AlignAfterOpenBracket: AlwaysBreak doesn't handling
                    long template parameter list.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: daphnediane at mac.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17217
  --> https://llvm.org/bugs/attachment.cgi?id=17217&action=edit
Simplified sample code that does not format correctly.

When both BreakBeforeBinaryOperators: All and AlignAfterOpenBracket:
AlwaysBreak formatting options are specified clang-format does not wrap really
long template lines.

I've attached a sample file that can show the problem.

The default works:
clang-format --style='{BasedOnStyle: llvm, BreakBeforeBinaryOperators: None,
AlignAfterOpenBracket: Align}' dummy.cxx

Changing BBBO to all but leaving AAOB as default also works.
clang-format --style='{BasedOnStyle: llvm, BreakBeforeBinaryOperators: All,
AlignAfterOpenBracket: Align}' dummy.cxx

Changing AAOB to AlwaysBreak but leaving BBBO as default also works.
clang-format --style='{BasedOnStyle: llvm, BreakBeforeBinaryOperators: None,
AlignAfterOpenBracket: AlwaysBreak}' dummy.cxx

But turning on both at once falls to wrap the line
clang-format --style='{BasedOnStyle: llvm, BreakBeforeBinaryOperators: All,
AlignAfterOpenBracket: AlwaysBreak}' dummy.cxx

-- 
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/20160907/4499c5c7/attachment-0001.html>


More information about the llvm-bugs mailing list