Don't put a space before ellipsis.

Before: template <class ... Ts> void Foo(Ts ... ts) { Foo(ts ...); }
After:  template <class... Ts> void Foo(Ts... ts) { Foo(ts...); }
llvm-svn: 181182
This commit is contained in:
Daniel Jasper 2013-05-06 06:35:44 +00:00
parent 4e18ca5200
commit 10cd581f95
2 changed files with 7 additions and 0 deletions

View File

@ -1055,6 +1055,8 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line,
return false;
if (Left.is(tok::l_brace) && Right.is(tok::r_brace))
return false;
if (Right.is(tok::ellipsis))
return false;
return true;
}

View File

@ -2602,6 +2602,11 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) {
verifyGoogleFormat("A = new SomeType* [Length];");
}
TEST_F(FormatTest, UnderstandsEllipsis) {
verifyFormat("int printf(const char *fmt, ...);");
verifyFormat("template <class... Ts> void Foo(Ts... ts) { Foo(ts...); }");
}
TEST_F(FormatTest, AdaptivelyFormatsPointersAndReferences) {
EXPECT_EQ("int *a;\n"
"int *a;\n"