forked from OSchip/llvm-project
clang-format: Improve ObjC blocks with return type.
Before: Block b = ^int * (A * a, B * b) {} After: Block b = ^int *(A *a, B *b) {} This fixed llvm.org/PR21619. llvm-svn: 222639
This commit is contained in:
parent
7198b0c778
commit
bb86d847ba
|
@ -1033,7 +1033,7 @@ private:
|
|||
|
||||
// It is very unlikely that we are going to find a pointer or reference type
|
||||
// definition on the RHS of an assignment.
|
||||
if (IsExpression)
|
||||
if (IsExpression && !Contexts.back().CaretFound)
|
||||
return TT_BinaryOperator;
|
||||
|
||||
return TT_PointerOrReference;
|
||||
|
|
|
@ -9412,6 +9412,7 @@ TEST_F(FormatTest, FormatsBlocks) {
|
|||
" }\n"
|
||||
" }\n"
|
||||
"});");
|
||||
verifyFormat("Block b = ^int *(A *a, B *b) {}");
|
||||
|
||||
FormatStyle FourIndent = getLLVMStyle();
|
||||
FourIndent.ObjCBlockIndentWidth = 4;
|
||||
|
|
Loading…
Reference in New Issue