[llvm-bugs] [Bug 39803] New: When breaking a comment and placing the second part on a new line, libformat should leave one whitespace between the text and the right-most star in C-style comments

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 26 22:46:26 PST 2018


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

            Bug ID: 39803
           Summary: When breaking a comment and placing the second part on
                    a new line, libformat should leave one whitespace
                    between the text and the right-most star in C-style
                    comments
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ehsan at mozilla.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

In C-style comments, some code can have the following pattern:

/*
 *
**/

When breaking comments across lines like this, libformat seems to put the next
line at the position of the left-most star + 2 to the right, which doesn't
leave enough whitespace between the text and the right-most star.

See the following test case which demonstrates the problem:

$ cat test.cpp
/*
 * Hello world, this is a comment that is longer than eighty characters
looooong!!!!
**/
$ clang-format -style=Google test.cpp
/*
 * Hello world, this is a comment that is longer than eighty characters
 *looooong!!!!
 **/

(Bugzilla may wrap lines, but in the test case, all of the text is on the same
line.)

-- 
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/20181127/1d6760f1/attachment-0001.html>


More information about the llvm-bugs mailing list