On Tue, 21 Jan 2020, Jason Merrill wrote:
On 1/20/20 8:06 PM, Patrick Palka wrote:
The leak in get_mapped_args is due to auto_vec not properly supporting
destructible elements, in that auto_vec's destructor doesn't call the
destructors of its elements.
Hmm, perhaps vec should static_assert __is_trivial(T) when supported.
Unfortunately this would break other seemingly well-behaved users of vec
in which T doesn't have a trivial default constructor. Relaxing the
condition to __has_trivial_copy(T) && __has_trivial_destructor(T) seems
to be fine though.
@@ -15344,6 +15344,7 @@ cp_literal_operator_id (const char* name)
+ strlen (name) + 10);
sprintf (buffer, UDLIT_OP_ANSI_FORMAT, name);
identifier = get_identifier (buffer);
+ free (buffer);
I guess we should use XDELETEVEC to match XNEWVEC. OK with that change.
Patch committed with that change.
Jason