c++: free garbage vec in coerce_template_parms
coerce_template_parms can create two different vecs for the inner template
arguments, new_inner_args and (potentially) the result of
expand_template_argument_pack. One or the other, or possibly both, end up
being garbage: in the typical case, the expanded vec is garbage because it's
only used as the source for convert_template_argument. In some dependent
cases, the new vec is garbage because we decide to return the original args
instead. In these cases, ggc_free the garbage vec to reduce the memory
overhead of overload resolution.
gcc/cp/ChangeLog:
* pt.cc (coerce_template_parms): Free garbage vecs.
Co-authored-by:
Richard Biener <rguenther@suse.de>
Loading
Please register or sign in to comment