Parameter pack in non-last position in function formal parameter list?

Marc Glisse marc.glisse@inria.fr
Fri Jun 19 16:50:00 GMT 2015


On Fri, 19 Jun 2015, Avi Kivity wrote:

> I wonder if gcc can give a better diagnostic here.  Instead of
>
>  ./variadic-function-nonlast.cc:9:15: note:   candidate expects 1 argument, 
> 4 provided
>
> it might say,
>
>   ./variadic-function-nonlast.cc:9:15: note:   candidate expects 1 argument, 
> 4 provided
> ./variadic-function-nonlast.cc:9:15: note:   parameter pack `X' in non-last 
> position deduced as empty parameter pack

I have no idea how hard that would be, but it could make sense. Feel free 
to file an enhancement PR on gcc's bugzilla. Do describe precisely the 
feature you are asking for. Also, it would help if you could add to that 
report the error messages from other compilers, for inspiration.

-- 
Marc Glisse



More information about the Gcc-help mailing list