On Mon, May 6, 2013 at 2:39 AM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div class="im"><div>On May 5, 2013, at 11:45 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>> wrote:</div><blockquote type="cite">
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 class="gmail_quote"><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>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></blockquote><div><br></div>
</div>Eh.  Star-on-the-right is born of wanting to make people mindful of the declarator grammar in the important places where you can have multiple declarators, and then just being consistent with that everywhere.  If declarator syntax didn't work that way, i.e. if types weren't awkwardly wrapped around the name at all or if the first declarator "prefix" was shared across all the declarations, I think star-on-the-right would clearly be the wrong thing to do.</div>
<div><br></div><div>Since, thankfully, there's no context that lets you re-use the tag keyword (template <class ...A,B,C>!), and the template clause is its own wonky thing in the grammar, I find that putting the ellipsis with the rest of the kind (in the formal sense) makes more sense.</div>
</div></blockquote><div><br></div><div>The meaning of the ellipsis is (very nearly!) consistently determined by the thing on its right; I want ellipsis-on-the-right to remind people of that. As with & and *, the "kind" is wrapped around the identifier, not just on the left. For instance, while ellipsis-on-the-left may look reasonable for "Ts... a[4]", it's deeply confusing for "int... a[Ns]". Plus "Ts &&... ts" looks dumb, whereas any of "Ts&&... ts", "Ts &&...ts", and "Ts&& ...ts" seem fine to me.</div>
<div><br></div><div>... and then there are the cases where we *must* put a space before the ellipsis, such as "f(xs + 1 ...)". In the interest of consistency, I think always putting a space before the ellipsis and never putting one after is the right choice (except for sizeof..., where the ellipsis is logically part of the token).</div>
</div>