Another \"who\'s right between g++ and clang++?\"
This time I\'m convinced it\'s a g++ bug, but I ask for a confirm from standard gurus.
Given the following cod
None of the three compilers is correct.
From [temp.param]/17:
If a template-parameter is a type-parameter with an ellipsis prior to its optional identifier or is a parameter-declaration that declares a pack ([dcl.fct]), then the template-parameter is a template parameter pack. A template parameter pack that is a parameter-declaration whose type contains one or more unexpanded packs is a pack expansion. ... A template parameter pack that is a pack expansion shall not expand a template parameter pack declared in the same template-parameter-list. [ Example:
...
template
// error: Values expands template type parameter struct static_array; // pack T within the same template parameter list — end example ]
So the code is ill-formed, even without the line foo(bar<0, 1L>{});
.
There is already a Clang bug report and a GCC bug report.