FormatToken *LeftOfParens = Tok.MatchingParen->getPreviousNonComment();
if (LeftOfParens) {
- // If there is an opening parenthesis left of the current parentheses,
+ // If there is a closing parenthesis left of the current parentheses,
// look past it as these might be chained casts.
if (LeftOfParens->is(tok::r_paren)) {
if (!LeftOfParens->MatchingParen ||
// Certain other tokens right before the parentheses are also signals that
// this cannot be a cast.
if (LeftOfParens->isOneOf(tok::at, tok::r_square, TT_OverloadedOperator,
- TT_TemplateCloser))
+ TT_TemplateCloser, tok::ellipsis))
return false;
}
TEST_F(FormatTest, UnderstandsBinaryOperators) {
verifyFormat("COMPARE(a, ==, b);");
+ verifyFormat("auto s = sizeof...(Ts) - 1;");
}
TEST_F(FormatTest, UnderstandsPointersToMembers) {