[PATCH] D43290: clang-format: tweak formatting of variable initialization blocks

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 27 08:49:54 PST 2018


djasper added inline comments.


================
Comment at: lib/Format/TokenAnnotator.cpp:2183
       return 0;
+    if (Left.Previous && Left.Previous->is(tok::equal) &&
+        !Style.Cpp11BracedListStyle)
----------------
Why is this necessary?


================
Comment at: unittests/Format/FormatTest.cpp:6655
+  FormatStyle AvoidBreakingFirstArgument = getLLVMStyle();
+  AvoidBreakingFirstArgument.PenaltyBreakBeforeFirstCallParameter = 200;
+  verifyFormat("const std::unordered_map<std::string, int> MyHashTable =\n"
----------------
How does this penalty influence the test?


Repository:
  rC Clang

https://reviews.llvm.org/D43290





More information about the cfe-commits mailing list