When a parameter pack is expanded the expanded parameters don't have default values.
Thus if a parameter pack is expanded after any arguments with a default value, the function is incorrectly rejected in CheckCXXDefaultArguments().
Fix this by removing default arguments for parameters before the last non-empty parameter pack.
By doing this we implement DR2233, which supersedes DR777.
Fixes PR23029.
This code is only reached when substituting into non-member functions, so this change would not address the corresponding problem for member function templates or for member functions of class templates. It would be better to handle this in InitFunctionInstantiation, which is called for all function instantiations. (But as noted below, doing this during instantiation doesn't seem to be correct.)
In any case, we should have some testcases for member functions.