-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[clang-format] Allow line breaking with PointerAlignment configured #164686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8644,6 +8644,28 @@ TEST_F(FormatTest, BreaksFunctionDeclarations) { | |
| " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}", | ||
| Style); | ||
|
|
||
| Style.ColumnLimit = 70; | ||
| verifyFormat( | ||
| "void foo(const MySuperSuperSuperSuperSuperSuperSuperSuperLongTypeName*\n" | ||
| " my_super_super_super_super_long_variable_name) {}", | ||
| Style); | ||
| verifyFormat( | ||
| "void foo(const MySuperSuperSuperSuperSuperSuperSuperSuperLongTypeName*\n" | ||
| " const my_super_super_super_super_long_variable_name) {}", | ||
|
Comment on lines
+8653
to
+8654
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The bug report says that they should be on separate lines because they can't fit on the same line. I don't see how to satisfy the requirement. Please post the formatted code.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See #139514 (comment). |
||
| Style); | ||
|
|
||
| Style.PointerAlignment = FormatStyle::PAS_Middle; | ||
| verifyFormat( | ||
| "void foo(\n" | ||
| " const MySuperSuperSuperSuperSuperSuperSuperSuperLongTypeName *\n" | ||
| " my_super_super_super_super_long_variable_name) {}", | ||
| Style); | ||
| verifyFormat( | ||
| "void foo(\n" | ||
| " const MySuperSuperSuperSuperSuperSuperSuperSuperLongTypeName *\n" | ||
| " const my_super_super_super_super_long_variable_name) {}", | ||
|
Comment on lines
+8665
to
+8666
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
| Style); | ||
|
|
||
| Style = getLLVMStyleWithColumns(45); | ||
| Style.PenaltyReturnTypeOnItsOwnLine = 400; | ||
| verifyFormat("template <bool abool, // a comment\n" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.