summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/TokenAnnotator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index faef560c898..2ddd2572dde 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -467,11 +467,13 @@ public:
KeywordVirtualFound = true;
if (CurrentToken->is(tok::period) || CurrentToken->is(tok::arrow))
++PeriodsAndArrows;
- if (getPrecedence(*CurrentToken) > prec::Assignment &&
- CurrentToken->isNot(tok::less) && CurrentToken->isNot(tok::greater))
- CanBeBuilderTypeStmt = false;
+ AnnotatedToken *TheToken = CurrentToken;
if (!consumeToken())
return LT_Invalid;
+ if (getPrecedence(*TheToken) > prec::Assignment &&
+ TheToken->Type != TT_TemplateOpener &&
+ TheToken->Type != TT_TemplateCloser)
+ CanBeBuilderTypeStmt = false;
}
if (KeywordVirtualFound)
return LT_VirtualFunctionDecl;
OpenPOWER on IntegriCloud