[llvm-bugs] [Bug 49300] New: Regression: chain of ternary operator will give unexpected line break formatting because of ColumnLimit

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Feb 21 11:47:53 PST 2021


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

            Bug ID: 49300
           Summary: Regression: chain of ternary operator will give
                    unexpected line break formatting because of
                    ColumnLimit
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: segura.mikael at orange.fr
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

Hello,
I identified a regression on the trunk of clang-format.
Here the example to reproduce the issue easily.

Simply put this line in test.cpp:
bool v = a ? b : c ? d : e;

Then add a .clang-format with:
ColumnLimit: 0

You will see that the text is then formatted like that:
bool v = a ? b : c ? d
                   : e;

-- 
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/20210221/002619b2/attachment.html>


More information about the llvm-bugs mailing list