[llvm-bugs] [Bug 37118] New: [Formatter/ObjC] BinPackArguments causes extra line breaks in blocks with protocol parameter types

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 12 17:23:16 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37118

            Bug ID: 37118
           Summary: [Formatter/ObjC] BinPackArguments causes extra line
                    breaks in blocks with protocol parameter types
           Product: clang
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david at dzhang.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

The second parameter (b) in these examples should not be on the next line.

input.m:
- (void)method {
    [self doSomething:^(BOOL a, id<NSCopying> b, NSString *c)];
    void (^blockName)(BOOL *a, id<NSCopying> b, NSString *c);
}

$ clang-format -style='{BinPackArguments: false, ColumnLimit: 40}' clang-bug.m 
- (void)method {
  [self doSomething:^(BOOL a,
                      id<NSCopying>
                          b,
                      NSString *c)];
  void (^blockName)(BOOL *a,
                    id<NSCopying>
                        b,
                    NSString *c);
}

$ clang-format --version
clang-format version 7.0.0 (tags/google/stable/2018-01-11)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180413/6d20a1de/attachment.html>


More information about the llvm-bugs mailing list