[PATCH] D33447: clang-format: add option to merge empty function body

Francois Ferrand via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 24 03:10:32 PDT 2017

Typz added a comment.

In https://reviews.llvm.org/D33447#763045, @djasper wrote:

> Does anything speak against making this behavior happen with AllowShortFunctionsOnASingleLine = SFS_Empty and MergeEmptyOnly.BraceWrapping.AfterFunction = true? I mean without the extra style option?

That is fine with me (with `AllowShortFunctionsOnASingleLine >= SFS_Empty` condition), but I see two things:

- it does not match the "OnASingleLine" part of that option's name, since in that case we get the function definition on one line, and the body on the next line
- some (existing) coding style may use `BraceWrapping.AfterFunction` and `AllowShortFunctionsOnASingleLine` (for exemple Mozilla), but may not want to change the behavior when the function cannot be merged on a single line


More information about the cfe-commits mailing list