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

strager via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 18 19:21:45 PST 2017


strager created this revision.
Herald added a subscriber: klimek.

clang-format completely ruins the formatting of block literal
expressions which appear inside inside braced initializer lists. For
example:

      int main() {
        foo({
  	  ^() {
  	    return nil;
      }
      });
      }

Teach clang-format to parse blocks inside braced lists:

  int main() {
    foo({^() {

return nil;

    }});
  }


https://reviews.llvm.org/D40221

Files:
  lib/Format/UnwrappedLineParser.cpp
  lib/Format/UnwrappedLineParser.h
  unittests/Format/FormatTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40221.123491.patch
Type: text/x-patch
Size: 5208 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171119/ca83861d/attachment.bin>


More information about the cfe-commits mailing list