<div dir="ltr">Interesting. I had a brief look at the LLVM codebase, and I found 43 cases of "class ..." and 145 cases of "class... ".</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 6, 2013 at 8:45 AM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Sun, May 5, 2013 at 11:35 PM, Daniel Jasper <span dir="ltr"><<a href="mailto:djasper@google.com" target="_blank">djasper@google.com</a>></span> wrote:<br>
</div><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: djasper<br>
Date: Mon May  6 01:35:44 2013<br>
New Revision: 181182<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=181182&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=181182&view=rev</a><br>
Log:<br>
Don't put a space before ellipsis.<br>
<br>
Before: template <class ... Ts> void Foo(Ts ... ts) { Foo(ts ...); }<br>
After:  template <class... Ts> void Foo(Ts... ts) { Foo(ts...); }<br></blockquote><div><br></div></div><div>I would think the star-on-the-right crowd (that is, the people who are right ;)) would actually want:</div>
<div>
<br></div><div>template <class ...Ts> void Foo(Ts ...ts) { Foo(ts...); }</div><div><br></div><div>... since the ellipsis, just like an & or *, binds to the thing on its right.</div><div><div class="h5"><div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Modified:<br>
    cfe/trunk/lib/Format/TokenAnnotator.cpp<br>
    cfe/trunk/unittests/Format/FormatTest.cpp<br>
<br>
Modified: cfe/trunk/lib/Format/TokenAnnotator.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/TokenAnnotator.cpp?rev=181182&r1=181181&r2=181182&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/TokenAnnotator.cpp?rev=181182&r1=181181&r2=181182&view=diff</a><br>


==============================================================================<br>
--- cfe/trunk/lib/Format/TokenAnnotator.cpp (original)<br>
+++ cfe/trunk/lib/Format/TokenAnnotator.cpp Mon May  6 01:35:44 2013<br>
@@ -1055,6 +1055,8 @@ bool TokenAnnotator::spaceRequiredBetwee<br>
     return false;<br>
   if (Left.is(tok::l_brace) && Right.is(tok::r_brace))<br>
     return false;<br>
+  if (Right.is(tok::ellipsis))<br>
+    return false;<br>
   return true;<br>
 }<br>
<br>
<br>
Modified: cfe/trunk/unittests/Format/FormatTest.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=181182&r1=181181&r2=181182&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=181182&r1=181181&r2=181182&view=diff</a><br>


==============================================================================<br>
--- cfe/trunk/unittests/Format/FormatTest.cpp (original)<br>
+++ cfe/trunk/unittests/Format/FormatTest.cpp Mon May  6 01:35:44 2013<br>
@@ -2602,6 +2602,11 @@ TEST_F(FormatTest, UnderstandsUsesOfStar<br>
   verifyGoogleFormat("A = new SomeType* [Length];");<br>
 }<br>
<br>
+TEST_F(FormatTest, UnderstandsEllipsis) {<br>
+  verifyFormat("int printf(const char *fmt, ...);");<br>
+  verifyFormat("template <class... Ts> void Foo(Ts... ts) { Foo(ts...); }");<br>
+}<br>
+<br>
 TEST_F(FormatTest, AdaptivelyFormatsPointersAndReferences) {<br>
   EXPECT_EQ("int *a;\n"<br>
             "int *a;\n"<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div></div></div><br>
</blockquote></div><br></div>