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

            Bug ID: 37111
           Summary: [Formatter/ObjC] @selector(method:arg:) tends to be
                    line-wrapped around the ( rather than :
           Product: clang
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangb...@nondot.org
          Reporter: da...@dzhang.com
                CC: djas...@google.com, kli...@google.com,
                    llvm-bugs@lists.llvm.org

clang-format binds method argument : tighter than @selector(, resulting in the
following odd formatting.

See also: https://bugs.chromium.org/p/chromium/issues/detail?id=711737

----------------------------------------

input.m:

- (void)test {
    if ([object
respondsToSelector:@selector(selectorNameThatIsReallyLong:param1:param2:)])
        return;
}

$ clang-format -style=llvm input.m

- (void)test {
  if ([object respondsToSelector:@selector
              (selectorNameThatIsReallyLong:param1:param2:)])
    return;
}

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

----------------------------------------

The @selector and its ( should remain together

I have not been able to find a combination of config options that avoids this
behavior.

-- 
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