[clang-format] Fix BraceWrapping AfterFunction for ObjC methods
authorBen Hamilton <benhamilton@google.com>
Fri, 12 Oct 2018 19:43:01 +0000 (19:43 +0000)
committerBen Hamilton <benhamilton@google.com>
Fri, 12 Oct 2018 19:43:01 +0000 (19:43 +0000)
commit97034a36cc09dc3f8b8f47250261f38acf4697be
tree06696d31b27b243c627ad97a41baf51fa3ece7ca
parenta6e3a823b3aac3cce6e5c0c3a5816c5f0ad2cd93
[clang-format] Fix BraceWrapping AfterFunction for ObjC methods

Summary:
> clang-format --version
> clang-format version 7.0.0 (tags/RELEASE_700/final)
> echo "@implementation Foo\n- (void)foo:(id)bar\n{\n}\n@end\n" |clang-format -style='{BreakBeforeBraces: Custom, BraceWrapping: {AfterFunction: true}}'
```
@implementation Foo
- (void)foo:(id)bar {
}
@end
```

with patch:

> bin/clang-format --version
> clang-format version 8.0.0 (trunk 344285)
> echo "@implementation Foo\n- (void)foo:(id)bar\n{\n}\n@end\n" |bin/clang-format -style='{BreakBeforeBraces: Custom, BraceWrapping: {AfterFunction: true}}'
```
@implementation Foo
- (void)foo:(id)bar
{
}
@end
```

Contributed by hultman@.

Reviewers: benhamilton, jolesiak, klimek, Wizard

Reviewed By: benhamilton

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D53197

llvm-svn: 344406
clang/lib/Format/UnwrappedLineParser.cpp
clang/unittests/Format/FormatTestObjC.cpp