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:
Daniel Jasper 2014-11-23 19:15:35 +00:00
parent 7198b0c778
commit bb86d847ba
2 changed files with 2 additions and 1 deletions

View File

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

View File

@ -9412,6 +9412,7 @@ TEST_F(FormatTest, FormatsBlocks) {
" }\n"
" }\n"
"});");
verifyFormat("Block b = ^int *(A *a, B *b) {}");
FormatStyle FourIndent = getLLVMStyle();
FourIndent.ObjCBlockIndentWidth = 4;