-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang-formatenhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing featuregood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute
Description
Bugzilla Link | 42156 |
Version | 8.0 |
OS | Windows NT |
Reporter | LLVM Bugzilla Contributor |
Extended Description
.clang-format file:
Language: Cpp
SpaceBeforeParens: ControlStatements
ColumnLimit: 0
After running clang-format the code is formatted as follows:
void Foo() {
new (place) Bar;
}
The new expression is not a control statement (the docs name for/if/while as examples). Instead, it works and feels much more like a function call. The parentheses are enclosing a parameter list, not a control expression. So this parameter list should be formatted like the one of a function call, like so:
void Foo() {
new(place) Bar;
}
Note the missing space before the parameter list.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang-formatenhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing featuregood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute