summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/TokenAnnotator.cpp
diff options
context:
space:
mode:
authorOwen Pan <owenpiano@gmail.com>2019-08-16 21:49:17 +0000
committerOwen Pan <owenpiano@gmail.com>2019-08-16 21:49:17 +0000
commitac67414618df9fdc24754b05cf438f8f7568f04a (patch)
treeb493b6805c3d7a3574ee2c12ac1970fbaa73342b /clang/lib/Format/TokenAnnotator.cpp
parent8341a847a22800056aa9a7bf446f47f1a530668f (diff)
downloadbcm5719-llvm-ac67414618df9fdc24754b05cf438f8f7568f04a.tar.gz
bcm5719-llvm-ac67414618df9fdc24754b05cf438f8f7568f04a.zip
[clang-format] Fix the bug that joins template closer and > or >>
Also fixes a buggy test case. See PR42404 Differential Revision: https://reviews.llvm.org/D66332 llvm-svn: 369157
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index c0533bbcbdc..62f7130dc89 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -919,6 +919,8 @@ private:
case tok::greater:
if (Style.Language != FormatStyle::LK_TextProto)
Tok->Type = TT_BinaryOperator;
+ if (Tok->Previous && Tok->Previous->is(TT_TemplateCloser))
+ Tok->SpacesRequiredBefore = 1;
break;
case tok::kw_operator:
if (Style.Language == FormatStyle::LK_TextProto ||
OpenPOWER on IntegriCloud