summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index db17135a0c7..f9b795ece90 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1052,7 +1052,10 @@ void TokenAnnotator::calculateFormattingInformation(AnnotatedLine &Line) {
Current->Next->is(tok::string_literal)) {
Current->MustBreakBefore = true;
} else if (Current->Previous->ClosesTemplateDeclaration &&
+ Current->Previous->MatchingParen &&
+ Current->Previous->MatchingParen->BindingStrength == 1 &&
Style.AlwaysBreakTemplateDeclarations) {
+ // FIXME: Fix horrible hack of using BindingStrength to find top-level <>.
Current->MustBreakBefore = true;
} else if (Current->Type == TT_CtorInitializerComma &&
Style.BreakConstructorInitializersBeforeComma) {
OpenPOWER on IntegriCloud