From ac67414618df9fdc24754b05cf438f8f7568f04a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 16 Aug 2019 21:49:17 +0000 Subject: [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 --- clang/lib/Format/TokenAnnotator.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/Format') 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 || -- cgit v1.2.3