int
abstract_virtuals_error_sfinae (tree decl, tree type, tsubst_flags_t complain)
{
- VEC(tree,gc) *pure;
+ vec<tree, va_gc> *pure;
/* This function applies only to classes. Any other entity can never
be abstract. */
error ("cannot allocate an object of abstract type %qT", type);
/* Only go through this once. */
- if (VEC_length (tree, pure))
+ if (pure->length ())
{
unsigned ix;
tree fn;
" because the following virtual functions are pure within %qT:",
type);
- FOR_EACH_VEC_ELT (tree, pure, ix, fn)
+ FOR_EACH_VEC_ELT (*pure, ix, fn)
if (! DECL_CLONED_FUNCTION_P (fn)
|| DECL_COMPLETE_DESTRUCTOR_P (fn))
inform (input_location, "\t%+#D", fn);
/* Now truncate the vector. This leaves it non-null, so we know
there are pure virtuals, but empty so we don't list them out
again. */
- VEC_truncate (tree, pure, 0);
+ pure->truncate (0);
}
else
inform (DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (type)),
split_non_constant_init into process_init_constructor_array,
that is separating constants from non-constants while building
the vector. */
- VEC_ordered_remove (constructor_elt, CONSTRUCTOR_ELTS (init),
- idx);
+ CONSTRUCTOR_ELTS (init)->ordered_remove (idx);
--idx;
if (array_type_p)
for static variable. In that case, caller must emit the code. */
tree
-store_init_value (tree decl, tree init, VEC(tree,gc)** cleanups, int flags)
+store_init_value (tree decl, tree init, vec<tree, va_gc>** cleanups, int flags)
{
tree value, type;
int flags = 0;
bool unbounded = false;
constructor_elt *ce;
- VEC(constructor_elt,gc) *v = CONSTRUCTOR_ELTS (init);
+ vec<constructor_elt, va_gc> *v = CONSTRUCTOR_ELTS (init);
gcc_assert (TREE_CODE (type) == ARRAY_TYPE
|| TREE_CODE (type) == VECTOR_TYPE);
len = TYPE_VECTOR_SUBPARTS (type);
/* There must not be more initializers than needed. */
- if (!unbounded && VEC_length (constructor_elt, v) > len)
+ if (!unbounded && vec_safe_length (v) > len)
{
if (complain & tf_error)
error ("too many initializers for %qT", type);
return PICFLAG_ERRONEOUS;
}
- FOR_EACH_VEC_ELT (constructor_elt, v, i, ce)
+ FOR_EACH_VEC_SAFE_ELT (v, i, ce)
{
if (ce->index)
{
process_init_constructor_record (tree type, tree init,
tsubst_flags_t complain)
{
- VEC(constructor_elt,gc) *v = NULL;
+ vec<constructor_elt, va_gc> *v = NULL;
int flags = 0;
tree field;
unsigned HOST_WIDE_INT idx = 0;
if (DECL_BIT_FIELD_TYPE (field))
type = DECL_BIT_FIELD_TYPE (field);
- if (idx < VEC_length (constructor_elt, CONSTRUCTOR_ELTS (init)))
+ if (idx < vec_safe_length (CONSTRUCTOR_ELTS (init)))
{
- constructor_elt *ce = &VEC_index (constructor_elt,
- CONSTRUCTOR_ELTS (init), idx);
+ constructor_elt *ce = &(*CONSTRUCTOR_ELTS (init))[idx];
if (ce->index)
{
/* We can have either a FIELD_DECL or an IDENTIFIER_NODE. The
CONSTRUCTOR_APPEND_ELT (v, field, next);
}
- if (idx < VEC_length (constructor_elt, CONSTRUCTOR_ELTS (init)))
+ if (idx < vec_safe_length (CONSTRUCTOR_ELTS (init)))
{
if (complain & tf_error)
error ("too many initializers for %qT", type);
int len;
/* If the initializer was empty, use default zero initialization. */
- if (VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (init)))
+ if (vec_safe_is_empty (CONSTRUCTOR_ELTS (init)))
return 0;
- len = VEC_length (constructor_elt, CONSTRUCTOR_ELTS (init));
+ len = CONSTRUCTOR_ELTS (init)->length ();
if (len > 1)
{
if (!(complain & tf_error))
return PICFLAG_ERRONEOUS;
error ("too many initializers for %qT", type);
- VEC_block_remove (constructor_elt, CONSTRUCTOR_ELTS (init), 1, len-1);
+ CONSTRUCTOR_ELTS (init)->block_remove (1, len-1);
}
- ce = &VEC_index (constructor_elt, CONSTRUCTOR_ELTS (init), 0);
+ ce = &(*CONSTRUCTOR_ELTS (init))[0];
/* If this element specifies a field, initialize via that field. */
if (ce->index)
tree orig_expr = expr;
tree type = TREE_TYPE (expr);
tree last_rval = NULL_TREE;
- VEC(tree,gc) *types_memoized = NULL;
+ vec<tree, va_gc> *types_memoized = NULL;
if (type == error_mark_node)
return error_mark_node;
return error_mark_node;
}
- VEC_safe_push (tree, gc, types_memoized, TREE_TYPE (expr));
+ vec_safe_push (types_memoized, TREE_TYPE (expr));
last_rval = expr;
}
/* The type to which we are casting. */
tree type;
- VEC(tree,gc) *parmvec;
+ vec<tree, va_gc> *parmvec;
if (exp == error_mark_node || parms == error_mark_node)
return error_mark_node;
/* Call the constructor. */
parmvec = make_tree_vector ();
for (; parms != NULL_TREE; parms = TREE_CHAIN (parms))
- VEC_safe_push (tree, gc, parmvec, TREE_VALUE (parms));
+ vec_safe_push (parmvec, TREE_VALUE (parms));
exp = build_special_member_call (NULL_TREE, complete_ctor_identifier,
&parmvec, type, LOOKUP_NORMAL, complain);
release_tree_vector (parmvec);