]> granicus.if.org Git - clang/commit
clang-format: Fix bug in ObjC method declaration formatting.
authorDaniel Jasper <djasper@google.com>
Sat, 23 Nov 2013 14:27:27 +0000 (14:27 +0000)
committerDaniel Jasper <djasper@google.com>
Sat, 23 Nov 2013 14:27:27 +0000 (14:27 +0000)
commit6a6a31d1e3b860cfeb4efc7c4e6c0173fc592986
tree2b81c721c582e107bd750ee4c93857ef19e95a17
parentfd39a7dd3a9e9b9a6a1653fe90d3e667dd777f66
clang-format: Fix bug in ObjC method declaration formatting.

Also disallow breaking between "@" and "{" or "[".

Before:
  - (NSAttributedString *)attributedStringForSegment:(NSUInteger)segment
                                               index:(NSUInteger)index
                                          attributes:(NSDictionary *)attributes
                                  nonDigitAttributes:(NSDictionary *)
      nonDigitAttributes;
  [mailComposeViewController
     setToRecipients:@
     [ NSBundle.mainBundle.infoDictionary[@"ABBFeedbackEmail"] ]];

After:
  - (NSAttributedString *)attributedStringForSegment:(NSUInteger)segment
                                               index:(NSUInteger)index
                                          attributes:(NSDictionary *)attributes
                                  nonDigitAttributes:
                                      (NSDictionary *)nonDigitAttributes;
  [mailComposeViewController
      setToRecipients:
          @[ NSBundle.mainBundle.infoDictionary[@"ABBFeedbackEmail"] ]];

This fixes llvm.org/PR18030.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195550 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTest.cpp