[PATCH] D11693: clang-format: Support generalized lambda captures.

Daniel Jasper via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 8 03:50:13 PDT 2015


djasper added a comment.

This is the corresponding bug: llvm.org/PR19986


================
Comment at: lib/Format/UnwrappedLineParser.cpp:1057-1058
@@ +1056,4 @@
+      while (!eof()) {
+        // FIXME: Once we have an expression parser in the UnwrappedLineParser,
+        // replace this by using parseAssigmentExpression() inside.
+        if (FormatTok->is(tok::l_paren)) {
----------------
I very much doubt that we'll have an Expression parser here anytime soon. So, I don't think that this FIXME makes much sense. Instead, please provide a comment on what this is actually doing and in which cases it might fail.

================
Comment at: lib/Format/UnwrappedLineParser.cpp:1061
@@ +1060,3 @@
+          parseParens();
+        } else if (FormatTok->isOneOf(tok::comma, tok::r_square)) {
+          break;
----------------
I think this list should be extended to figure out certain cases where we know something is fishy. In particular:
* If you find an l_square or less, call into parseSquare and parseAngle respectively.
* If you find an r_brace or semi, something is wrong, break.



http://reviews.llvm.org/D11693





More information about the cfe-commits mailing list