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

            Bug ID: 45018
           Summary: A newline is added after a string token if the next 2
                    tokens are lessless and string
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangb...@nondot.org
          Reporter: jeffrey.vandegl...@nobelbiocare.com
                CC: djas...@google.com, kli...@google.com,
                    llvm-bugs@lists.llvm.org

Created attachment 23166
  --> https://bugs.llvm.org/attachment.cgi?id=23166&action=edit
File to verify two streamed strings aren't split

Given the code:

 QStringList() << "something" << "something" << variable;

If I then run clang-format with the default config file, the output is the
following code:

 QStringList() << "something"
               << "something" << variable

What I expected, was that it stays on a single line, unless it exceeds the
column limit and possible penalties. In this case, untouched.

It stays untouched when I add a variable in between:

 QStringList() << "something" << a << "something" << variable;

Looking at the code, I noticed that somebody intentionally introduced this to
split endline characters in commit df28f7b8dd6a032515109de4ff5b4067be95da8e
(currently at lib/Format/TokenAnnotator.cpp, line 3073).

In the attachment I added a file with a slightly different example that I used
when debugging clang-format.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to