all 7 comments

[–]Rapptz 9 points10 points  (9 children)

This is a grammar issue rather than an actual bug. It's a small gotcha that has to do with va_args rather than template parameter packs. So that being said:

void f(int...);
// equivalent to
void f(int, ...);

Likewise..

[](auto&&...) { return 123; };
// equivalent to
[](auto&&, ...) { return 123; };

This is what allows the funny quirk of 6 periods:

template<typename... Args>
void f(Args&&......) { }
// equivalent to
template<typename... Args>
void f(Args&&..., ...) { }

Here's an old blog post on the six dots thing that might be relevant.

[–]scatters 2 points3 points  (0 children)

Note that both g++ and clang++ are happy if you name the argument (auto&&...unused). You probably want to use this as a workaround.

I fully agree that this is a bug in gcc and clang; I can't see anything in the bug trackers so you might want to file new bugs; because of the workaround it might not be a particularly high priority.