Index: lib/Format/FormatTokenLexer.cpp =================================================================== --- lib/Format/FormatTokenLexer.cpp +++ lib/Format/FormatTokenLexer.cpp @@ -96,12 +96,8 @@ } if (Style.Language == FormatStyle::LK_Java) { - static const tok::TokenKind JavaRightLogicalShift[] = { - tok::greater, tok::greater, tok::greater}; static const tok::TokenKind JavaRightLogicalShiftAssign[] = { tok::greater, tok::greater, tok::greaterequal}; - if (tryMergeTokens(JavaRightLogicalShift, TT_BinaryOperator)) - return; if (tryMergeTokens(JavaRightLogicalShiftAssign, TT_BinaryOperator)) return; } Index: lib/Format/TokenAnnotator.cpp =================================================================== --- lib/Format/TokenAnnotator.cpp +++ lib/Format/TokenAnnotator.cpp @@ -47,7 +47,7 @@ if (NonTemplateLess.count(CurrentToken->Previous)) return false; - const FormatToken &Previous = *CurrentToken->Previous; + const FormatToken &Previous = *CurrentToken->Previous; // The '<'. if (Previous.Previous) { if (Previous.Previous->Tok.isLiteral()) return false; @@ -2323,7 +2323,7 @@ if (Left.is(TT_TemplateCloser) && Left.MatchingParen && Left.MatchingParen->Previous && Left.MatchingParen->Previous->is(tok::period)) - // A.DoSomething(); + // A.>>DoSomething(); return false; if (Left.is(TT_TemplateCloser) && Right.is(tok::l_square)) return false; Index: unittests/Format/FormatTestJava.cpp =================================================================== --- unittests/Format/FormatTestJava.cpp +++ unittests/Format/FormatTestJava.cpp @@ -333,6 +333,11 @@ verifyFormat("Iterable a;"); verifyFormat("A.doSomething();"); + verifyFormat("A.>doSomething();"); + verifyFormat("A.>>doSomething();"); + verifyFormat("A.>>>doSomething();"); + + verifyFormat("OrderedPair>> p = null;"); verifyFormat("@Override\n" "public Map getAll() {}");