[llvm-bugs] [Bug 38872] New: Unexpected break before lessless if it is between two strings

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 7 14:22:49 PDT 2018


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

            Bug ID: 38872
           Summary: Unexpected break before lessless if it is between two
                    strings
           Product: clang
           Version: 6.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jzpigtc4zsi at 0box.eu
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

$ echo -e 'void fu(void) {\ncout << "A" << "B" << "C" << D << "E" << "F" <<
"G"\n}' | clang-format -style="{BasedOnStyle: LLVM, AlignAfterOpenBracket:
DontAlign, AlignOperands: false}"
void fu(void) {
  cout << "A"
       << "B"
       << "C" << D << "E"
       << "F"
       << "G"
}

clang-format inserts an (unwanted) break before a lessless (stream insertion)
operator if (and only if) it is between two string literals. Why? Is there any
intention or rationale? (ColumnLimit cannot be a cause.)

Moreover the lessless-es get aligned, despite that no alignment is allowed.

-- 
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/20180907/623b7849/attachment.html>


More information about the llvm-bugs mailing list