[PATCH] D14104: clang-format: Add an additional value to AlignAfterOpenBracket: AlwaysBreak.

Daniel Jasper via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 27 03:14:08 PDT 2015


djasper added inline comments.

================
Comment at: lib/Format/ContinuationIndenter.cpp:882
@@ -876,1 +881,3 @@
                                         State.Stack.back().NestedBlockIndent);
+  bool NoLineBreak = State.Stack.back().NoLineBreak ||
+                     (Current.is(TT_TemplateOpener) &&
----------------
mprobst wrote:
> Maybe add a comment on how this works? It's not clear to me. Is this change (with the assignment below) to allow breaks in block-style literals?
Yes. Added a comment.

================
Comment at: lib/Format/TokenAnnotator.cpp:393
@@ -392,6 +392,3 @@
   void updateParameterCount(FormatToken *Left, FormatToken *Current) {
-    if (Current->is(TT_LambdaLSquare) ||
-        (Current->is(tok::caret) && Current->is(TT_UnaryOperator)) ||
-        (Style.Language == FormatStyle::LK_JavaScript &&
-         Current->is(Keywords.kw_function))) {
+    if (Current->is(tok::l_brace) && !Current->is(TT_DictLiteral))
       ++Left->BlockParameterCount;
----------------
mprobst wrote:
> I don't understand why this changes how we count block parameters - is this an unrelated cleanup?
The other changes uncovered that we weren't properly counting nested Java blocks.


http://reviews.llvm.org/D14104





More information about the cfe-commits mailing list