[PATCH] D40221: [clang-format] Parse blocks in braced lists

Ben Hamilton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 23 08:38:42 PDT 2018

benhamilton edited reviewers, added: klimek; removed: djasper.
benhamilton added a comment.

@djasper isn't available to review.

At a high level, this seems good, but I'd like @klimek to take a look.

Comment at: lib/Format/UnwrappedLineParser.cpp:1320
+// \endcode
+bool UnwrappedLineParser::tryToParseBlock() {
+  // Consume the leading ^.
Is it standard to return a value from these `tryToParseFoo()` methods, even if nobody uses it?

I think we should either check the return value somewhere, or make this return `void`.

Comment at: lib/Format/UnwrappedLineParser.cpp:1324-1327
+  if (!Style.isCpp()) {
+    // Blocks are only supported in C++ and Objective-C.
+    return false;
+  }
Style: Remove curly braces for one-line if blocks.


More information about the cfe-commits mailing list