return !Left.isOneOf(tok::identifier, tok::greater, tok::l_paren);
if (Left.is(tok::less) || Right.isOneOf(tok::greater, tok::less))
return false;
+ if (Right.is(tok::ellipsis))
+ return false;
if (Right.Type == TT_PointerOrReference)
return Left.Tok.isLiteral() ||
((Left.Type != TT_PointerOrReference) && Left.isNot(tok::l_paren) &&
if (Left.isOneOf(tok::identifier, tok::greater, tok::r_square) &&
Right.is(tok::l_brace) && Right.getNextNoneComment())
return false;
- if (Right.is(tok::ellipsis))
- return false;
if (Left.is(tok::period) || Right.is(tok::period))
return false;
if (Left.Type == TT_BlockComment && Left.TokenText.endswith("=*/"))
TEST_F(FormatTest, UnderstandsEllipsis) {
verifyFormat("int printf(const char *fmt, ...);");
verifyFormat("template <class... Ts> void Foo(Ts... ts) { Foo(ts...); }");
+ verifyFormat("template <class... Ts> void Foo(Ts *... ts) {}");
+
+ FormatStyle PointersLeft = getLLVMStyle();
+ PointersLeft.PointerBindsToType = true;
+ verifyFormat("template <class... Ts> void Foo(Ts*... ts) {}", PointersLeft);
}
TEST_F(FormatTest, AdaptivelyFormatsPointersAndReferences) {