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

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 24 05:39:11 PDT 2017


djasper added a comment.

No, I don't think it should be done this way and neither Facebook nor Mozilla coding styles say you should.

Mozilla style has an explicit example:

  int TinyFunction() { return mVar; }

Facebook style has an explicit example:

  MyClass::MyClass(uint64_t idx) : m_idx(idx) {}

Moving the "{}" to the next line is only ok if the complete function/constructor definition (up to and including the "}") does not fit on one line.


https://reviews.llvm.org/D33447





More information about the cfe-commits mailing list