+2018-01-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/83825
+ * name-lookup.c (member_vec_dedup): Return early if len is 0.
+ (resort_type_member_vec, set_class_bindings,
+ insert_late_enum_def_bindings): Use vec qsort method instead of
+ calling qsort directly.
+
2018-01-15 Martin Sebor <msebor@redhat.com>
PR c++/83588
{
resort_data.new_value = new_value;
resort_data.cookie = cookie;
- qsort (member_vec->address (), member_vec->length (),
- sizeof (tree), resort_member_name_cmp);
+ member_vec->qsort (resort_member_name_cmp);
}
}
unsigned len = member_vec->length ();
unsigned store = 0;
+ if (!len)
+ return;
+
tree current = (*member_vec)[0], name = OVL_NAME (current);
tree next = NULL_TREE, next_name = NULL_TREE;
for (unsigned jx, ix = 0; ix < len;
if (member_vec)
{
CLASSTYPE_MEMBER_VEC (klass) = member_vec;
- qsort (member_vec->address (), member_vec->length (),
- sizeof (tree), member_name_cmp);
+ member_vec->qsort (member_name_cmp);
member_vec_dedup (member_vec);
}
}
else
member_vec_append_class_fields (member_vec, klass);
CLASSTYPE_MEMBER_VEC (klass) = member_vec;
- qsort (member_vec->address (), member_vec->length (),
- sizeof (tree), member_name_cmp);
+ member_vec->qsort (member_name_cmp);
member_vec_dedup (member_vec);
}
}