summaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-16 09:53:40 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-16 09:53:40 +0000
commit03106e7d8b8a71634ead1053bf65ab8f881975bc (patch)
tree05f087296df6da2876dbac64a95198a03423740d /gcc/cp/class.c
parente5333be771b8f89597e2cca8d78cc2c3cf3312a6 (diff)
downloadgcc-03106e7d8b8a71634ead1053bf65ab8f881975bc.tar.gz
* cp-tree.h (struct lang_type_class): Make pure_virtuals a
VEC(tree). (CLASSTYPE_INLINE_FRIENDS, CLASSTYPE_PURE_VIRTUALS): Update comments. * call.c (build_new_method_call): Don't confirm a pure virtual is in CLASSTYPE_PURE_VIRTUALS. Reorder checks. Make it a warning. * class.c (check_methods): CLASSTYPE_INLINE_FRIENDS is a VEC(tree). (fixup_inline_methods, finish_struct): Likewise. * decl.c (finish_method): Likewise. * search.c (dfs_get_pure_virtuals, get_pure_virtuals): CLASSTYPE_PURE_VIRTUALS is a VEC(tree). * typeck2.c (abstract_virtuals_error): Likewise. Truncate the vector to avoid repeating the list in error messages. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87592 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index d31295a87a6..a92bb8e81f2 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -3750,8 +3750,7 @@ check_methods (tree t)
{
TYPE_POLYMORPHIC_P (t) = 1;
if (DECL_PURE_VIRTUAL_P (x))
- CLASSTYPE_PURE_VIRTUALS (t)
- = tree_cons (NULL_TREE, x, CLASSTYPE_PURE_VIRTUALS (t));
+ VEC_safe_push (tree, CLASSTYPE_PURE_VIRTUALS (t), x);
}
}
}
@@ -4281,6 +4280,8 @@ static void
fixup_inline_methods (tree type)
{
tree method = TYPE_METHODS (type);
+ VEC (tree) *friends;
+ unsigned ix;
if (method && TREE_CODE (method) == TREE_VEC)
{
@@ -4297,11 +4298,10 @@ fixup_inline_methods (tree type)
fixup_pending_inline (method);
/* Do friends. */
- for (method = CLASSTYPE_INLINE_FRIENDS (type);
- method;
- method = TREE_CHAIN (method))
- fixup_pending_inline (TREE_VALUE (method));
- CLASSTYPE_INLINE_FRIENDS (type) = NULL_TREE;
+ for (friends = CLASSTYPE_INLINE_FRIENDS (type), ix = 0;
+ VEC_iterate (tree, friends, ix, method); ix++)
+ fixup_pending_inline (method);
+ CLASSTYPE_INLINE_FRIENDS (type) = NULL;
}
/* Add OFFSET to all base types of BINFO which is a base in the
@@ -5183,11 +5183,10 @@ finish_struct (tree t, tree attributes)
the PARM_DECLS. Note that while the type is being defined,
CLASSTYPE_PURE_VIRTUALS contains the list of the inline friends
(see CLASSTYPE_INLINE_FRIENDS) so we need to clear it. */
- CLASSTYPE_PURE_VIRTUALS (t) = NULL_TREE;
+ CLASSTYPE_PURE_VIRTUALS (t) = NULL;
for (x = TYPE_METHODS (t); x; x = TREE_CHAIN (x))
if (DECL_PURE_VIRTUAL_P (x))
- CLASSTYPE_PURE_VIRTUALS (t)
- = tree_cons (NULL_TREE, x, CLASSTYPE_PURE_VIRTUALS (t));
+ VEC_safe_push (tree, CLASSTYPE_PURE_VIRTUALS (t), x);
complete_vars (t);
}
else