[Bug c++/57397] Off-by-one error in diagnostic when calling variadic function template with too few arguments

paolo.carlini at oracle dot com gcc-bugzilla@gcc.gnu.org
Fri May 24 17:20:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57397

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> ---
The core issue is very simple. Funny however the error messages you can get for
some other invalid cases, like I tried:

template<class T1, class... T2, class... Tn>
void boo(T1, T2..., Tn...)
{ }

int main()
{
  boo(1);
}

then my clang++ (not very up to date) says at least 2 arguments are needed. For
fun you give 2 and it says that 1 is required ;) ICC doesn't even try
suggesting the right number ;) I guess that while we are at it we want to say
"at least 2" for the original testcase filed by Jon (thus we can't just call
unify_arity with the right arguments) and then better handle in the diagnostic
parameters which can't be deduced anyway.



More information about the Gcc-bugs mailing list