-
Notifications
You must be signed in to change notification settings - Fork 15.5k
[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 1 commit
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,38 @@ TEST_F(FormatTest, BreaksFunctionDeclarations) { | |
| " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}", | ||
| Style); | ||
|
|
||
| Style.ColumnLimit = 70; | ||
| verifyFormat( | ||
HazardyKnusperkeks marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "void foo( //\n" | ||
| " const MySuperSuperSuperSuperSuperSuperSuperSuperLongTypeName*\n" | ||
| " const my_super_super_super_super_long_variable_name) {}", | ||
| Style); | ||
| 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) {}", | ||
| Style); | ||
|
|
||
| Style.PointerAlignment = FormatStyle::PAS_Middle; | ||
| 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); | ||
| 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) {}", | ||
| 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.