Your third variant's second non-type param should have prefix typename
not class
:
template::type = 0>
void foo(T2... args);
..
foo(1,2,3);
Check it
Gcc 4.7.0 snapshots has some bugs with templates I guess, if you try it with gcc 4.6.2/1 it shall work.