diff options
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 2 | ||||
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 346af61199c..a36f9630e68 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -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; diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index fceebfadea7..58680e07343 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -9412,6 +9412,7 @@ TEST_F(FormatTest, FormatsBlocks) { " }\n" " }\n" "});"); + verifyFormat("Block b = ^int *(A *a, B *b) {}"); FormatStyle FourIndent = getLLVMStyle(); FourIndent.ObjCBlockIndentWidth = 4; |

