================
@@ -1921,6 +1921,10 @@ void UnwrappedLineParser::parseStructuralElement(
}
} else if (Style.BraceWrapping.AfterFunction) {
addUnwrappedLine();
+ } else if (Style.AllowShortFunctionBodiesOnASingleLine) {
+ // Wrap the left brace here; we'll try to merge it back
----------------
brandb97 wrote:
If `Style.AllowShortFunctionBodiesOnSingleLine = true`, I modified
UnwrappedLineParser to parse
```
int main() {
//...
}
```
into unwrapped lines ["int main()", "{", ..., "}"], not ["int main() {", ...,
"}"] as usual. If clang-format can't put function body on a single line, I want
to merge "int main()" and "{" back if possible.
https://github.com/llvm/llvm-project/pull/151428
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits