[PATCH] D40988: Clang-format: add finer-grained options for putting all arguments on one line

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun May 20 23:41:17 PDT 2018


djasper added inline comments.


================
Comment at: lib/Format/ContinuationIndenter.cpp:760
         (!Style.AllowAllParametersOfDeclarationOnNextLine &&
          State.Line->MustBeDeclaration) ||
+        (!Style.AllowAllArgumentsOnNextLine &&
----------------
This still looks suspicious to me. State.Line->MustBeDeclaration is either true or false meaning that AllowAllParametersOfDeclarationOnNextLine or AllowAllArgumentsOnNextLine can always affect the behavior here, leading to BreakBeforeParameter to be set to true, even if we are in the case for PreviousIsBreakingCtorInitializerColon being true.

So, my guess would be that if you set one of AllowAllArgumentsOnNextLine and AllowAllParametersOfDeclarationOnNextLine to false, then AllowAllConstructorInitializersOnNextLine doesn't have an effect anymore.

Please verify, and if this is true, please fix and add tests. I think this might be easier to understand if you pulled the one if statement apart.


https://reviews.llvm.org/D40988





More information about the cfe-commits mailing list