r181182 - Don't put a space before ellipsis.

John McCall rjmccall at apple.com
Mon May 6 02:39:30 PDT 2013

On May 5, 2013, at 11:45 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> On Sun, May 5, 2013 at 11:35 PM, Daniel Jasper <djasper at google.com> wrote:
> Author: djasper
> Date: Mon May  6 01:35:44 2013
> New Revision: 181182
> URL: http://llvm.org/viewvc/llvm-project?rev=181182&view=rev
> Log:
> 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...); }
> I would think the star-on-the-right crowd (that is, the people who are right ;)) would actually want:
> template <class ...Ts> void Foo(Ts ...ts) { Foo(ts...); }
> ... since the ellipsis, just like an & or *, binds to the thing on its right.

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.

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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130506/df7f923d/attachment.html>

More information about the cfe-commits mailing list