[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 05:55:09 PDT 2017

Typz added a comment.

Right, I was not clear enough: this is indeed done only if everything does not fit on one line.

There is an exemple in facebook's coding style:

  MyClass::MyClass(const Class* cls, const Func* func, const Class* ctx)
    : m_cls(cls)
    , m_func(func)
    , m_ctx(ctx)
    , m_isMyConditionMet(false)

And this happens (with the extra space) in the same kind of situation in Mozilla's code:

  nsSameProcessAsyncMessageBase::nsSameProcessAsyncMessageBase(JS::RootingContext* aRootingCx,
                                                               JS::Handle<JSObject*> aCpows)
    : mRootingCx(aRootingCx)
    , mCpows(aRootingCx, aCpows)
  { }


More information about the cfe-commits mailing list