Skip to content

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 #39150

@ehsan

Description

@ehsan
Bugzilla Link 39803
Version unspecified
OS Linux
CC @sylvestre

Extended Description

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.)

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions