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: unassignedclangb...@nondot.org
          Reporter: da...@dzhang.com
                CC: djas...@google.com, kli...@google.com,
                    llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to