Skip to content

Commit 7e1fd91

Browse files
author
git apple-llvm automerger
committed
Merge commit '7595fa689e4f' from apple/master into swift/master-next
2 parents 4216449 + 7595fa6 commit 7e1fd91

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

clang/lib/Format/TokenAnnotator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1757,7 +1757,7 @@ class AnnotatingParser {
17571757
// Use heuristics to recognize unary operators.
17581758
if (PrevToken->isOneOf(tok::equal, tok::l_paren, tok::comma, tok::l_square,
17591759
tok::question, tok::colon, tok::kw_return,
1760-
tok::kw_case, tok::at, tok::l_brace))
1760+
tok::kw_case, tok::at, tok::l_brace, tok::kw_throw))
17611761
return TT_UnaryOperator;
17621762

17631763
// There can't be two consecutive binary operators.

clang/unittests/Format/FormatTest.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6912,6 +6912,7 @@ TEST_F(FormatTest, UnderstandsUnaryOperators) {
69126912
verifyFormat("alignof(char);", getGoogleStyle());
69136913

69146914
verifyFormat("return -1;");
6915+
verifyFormat("throw -1;");
69156916
verifyFormat("switch (a) {\n"
69166917
"case -1:\n"
69176918
" break;\n"

0 commit comments

Comments
 (0)