diff options
| author | Daniel Jasper <djasper@google.com> | 2014-01-16 19:14:34 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2014-01-16 19:14:34 +0000 |
| commit | a225bcedb49cbf99b25c2c31d9de2c1ede3c0fa3 (patch) | |
| tree | 714dabd9b999146d6cd20e8aaaaf595ff952c33f /clang/unittests | |
| parent | e3a16be52eab5b5b5f40997fc90a0b879a95174b (diff) | |
| download | bcm5719-llvm-a225bcedb49cbf99b25c2c31d9de2c1ede3c0fa3.tar.gz bcm5719-llvm-a225bcedb49cbf99b25c2c31d9de2c1ede3c0fa3.zip | |
clang-format: Improve formatting of ObjC Blocks with return type.
Before:
int a = [operation block:^int(int * i) { return 1; }];
After:
int a = [operation block:^int(int *i) { return 1; }];
llvm-svn: 199411
Diffstat (limited to 'clang/unittests')
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 910df459761..c75df9ce151 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -7907,6 +7907,10 @@ TEST_F(FormatTest, FormatsBlocks) { verifyFormat("int i = {[operation setCompletionBlock : ^{ [self " "onOperationDone]; }] };"); verifyFormat("[operation setCompletionBlock:^(int *i) { f(); }];"); + verifyFormat("int a = [operation block:^int(int *i) { return 1; }];"); + verifyFormat("[myObject doSomethingWith:arg1\n" + " aaa:^int(int *a) { return 1; }\n" + " bbb:f(a * b)];"); verifyFormat("[operation setCompletionBlock:^{\n" " [self.delegate newDataAvailable];\n" |

