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.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index f926beb1066..bce1d64166f 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1684,7 +1684,8 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line,
} else if (Style.Language == FormatStyle::LK_Java) {
if (Left.is(Keywords.kw_synchronized) && Right.is(tok::l_paren))
return Style.SpaceBeforeParens != FormatStyle::SBPO_Never;
- if (Left.is(tok::kw_static) && Right.Type == TT_TemplateOpener)
+ if (Left.isOneOf(tok::kw_static, tok::kw_public) &&
+ Right.Type == TT_TemplateOpener)
return true;
}
if (Right.Tok.getIdentifierInfo() && Left.Tok.getIdentifierInfo())
OpenPOWER on IntegriCloud