[PATCH] D32475: [clang-format] Don’t propagate AvoidBinPacking into argument subexpressions

Jacob Bandes-Storch via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 26 13:23:01 PDT 2017


jtbandes added inline comments.


================
Comment at: unittests/Format/FormatTest.cpp:2597
+  Style.AlignAfterOpenBracket = FormatStyle::BAS_AlwaysBreak;
+  Style.BreakBeforeBinaryOperators = FormatStyle::BOS_NonAssignment;
+  Style.BinPackArguments = false;
----------------
djasper wrote:
> Does this bug only happen when breaking before operators? If not can you add a test case with None?
Yeah it is only when breaking before operators, because the condition which causes `mustBreak` to be true includes `Current.CanBreakBefore`.


================
Comment at: unittests/Format/FormatTest.cpp:2599
+  Style.BinPackArguments = false;
+  Style.BinPackParameters = false;
+  verifyFormat(StringRef(R"(
----------------
djasper wrote:
> This is not tested/changed at all, I think.
That's a good point. I had this because my test code is a function call at the top level, which is treated as a signature rather than a call. I will wrap it in another block and remove the BinPackParameters setting.


https://reviews.llvm.org/D32475





More information about the cfe-commits mailing list