On May 5, 2013, at 11:45 PM, Richard Smith <[email protected]> wrote:
> On Sun, May 5, 2013 at 11:35 PM, Daniel Jasper <[email protected]> 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.

John.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to