summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/TokenAnnotator.cpp
diff options
context:
space:
mode:
authorBrian Gesiak <modocache@gmail.com>2019-11-30 15:36:35 -0500
committerBrian Gesiak <modocache@gmail.com>2019-11-30 15:47:58 -0500
commit8682d29a28772bab0283a141b8701bfaea8881a6 (patch)
tree2a5c48ada05c62a143f2cd2db3b5ac2f08de3537 /clang/lib/Format/TokenAnnotator.cpp
parent40dfc6dff10bd8881c6df31884e2184bbaab5698 (diff)
downloadbcm5719-llvm-8682d29a28772bab0283a141b8701bfaea8881a6.tar.gz
bcm5719-llvm-8682d29a28772bab0283a141b8701bfaea8881a6.zip
[Format] Add format check for coroutine keywords with negative numbers
Summary: As a followup to D69144, this diff fixes the coroutine keyword spacing for co_yield / co_returning negative numbers. Reviewers: modocache, sammccall, Quuxplusone Reviewed By: modocache Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69180 Patch by Jonathan Thomas (jonathoma)!
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 9fe7fdc9ce9..74ff5b53149 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1829,7 +1829,8 @@ private:
// Use heuristics to recognize unary operators.
if (PrevToken->isOneOf(tok::equal, tok::l_paren, tok::comma, tok::l_square,
tok::question, tok::colon, tok::kw_return,
- tok::kw_case, tok::at, tok::l_brace, tok::kw_throw))
+ tok::kw_case, tok::at, tok::l_brace, tok::kw_throw,
+ tok::kw_co_return, tok::kw_co_yield))
return TT_UnaryOperator;
// There can't be two consecutive binary operators.
OpenPOWER on IntegriCloud