On 5/22/19 5:50 PM, Marek Polacek wrote:
On Wed, May 22, 2019 at 12:17:04AM -0400, Jason Merrill wrote:
On 5/20/19 6:08 PM, Marek Polacek wrote:
We ICE here because we are accessing call_args even though it's empty:

(gdb) p (*call_args).is_empty()
$5 = true

It's empty because the pack processed by tsubst_pack_expansion expanded into an
empty vector, so nothing got pushed onto call_args.  So handle that, and also
handle pushing 'this' properly when call_args is empty.

Ah, the problem is that nargs is just wrong in the presence of pack
expansions; in this case it's too large, but it could also end up too small.
What we want is the length of call_args, not the number of args before doing
the expansions.

Oh, right.  I've expanded the test to also detect the case when the number of
arguments grows after any packs have been expanded.  We still need the special
handling when adding 'this', though.

Thanks for catching the other problem!

Bootstrapped/regtested on x86_64-linux, ok for trunk and 9?

OK, thanks.

Jason

Reply via email to