diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-05-19 10:44:22 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-05-19 10:44:22 +0000 |
commit | 128e1d722d6a685ec6be49e5f11739ba9a76f9a8 (patch) | |
tree | f4a2d76ef728e21180a863ba3b68bc67af34dcce /gcc/cp/search.c | |
parent | 1fbf52a75a96a90bd4f02656971541ea9bfb1864 (diff) | |
download | gcc-128e1d722d6a685ec6be49e5f11739ba9a76f9a8.tar.gz |
Implement anonymous structs.
* cp-tree.h (ANON_AGGR_TYPE_P): Rename from ANON_UNION_TYPE_P.
* class.c, decl.c, decl2.c, init.c, pt.c, search.c, typeck.c: Adjust.
* class.c (finish_struct_1): Remove redundant check for anon struct.
* decl.c (fixup_anonymous_aggr): Renamed from fixup_anonymous_union.
(check_tag_decl): Check for anonymous struct here.
* decl2.c (build_anon_union_vars): Catch anon struct at file scope.
* init.c (sort_member_init, emit_base_init): Handle getting fields
as well as names in current_member_init_list.
(perform_member_init): Handle getting an anon aggr.
* method.c (do_build_assign_ref): Don't descend into anon aggrs.
(do_build_copy_constructor): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@27027 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/search.c')
-rw-r--r-- | gcc/cp/search.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 12133589871..906aa131b3d 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -534,7 +534,7 @@ lookup_field_1 (type, name) #endif /* GATHER_STATISTICS */ my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (field)) == 'd', 0); if (DECL_NAME (field) == NULL_TREE - && TREE_CODE (TREE_TYPE (field)) == UNION_TYPE) + && ANON_AGGR_TYPE_P (TREE_TYPE (field))) { tree temp = lookup_field_1 (TREE_TYPE (field), name); if (temp) @@ -610,7 +610,7 @@ context_for_name_lookup (decl) declared. */ tree context = DECL_REAL_CONTEXT (decl); - while (TYPE_P (context) && ANON_UNION_TYPE_P (context)) + while (TYPE_P (context) && ANON_AGGR_TYPE_P (context)) context = TYPE_CONTEXT (context); if (!context) context = global_namespace; @@ -2927,7 +2927,7 @@ dfs_push_decls (binfo, data) && TREE_CODE (fields) != USING_DECL) setup_class_bindings (DECL_NAME (fields), /*type_binding_p=*/0); else if (TREE_CODE (fields) == FIELD_DECL - && ANON_UNION_TYPE_P (TREE_TYPE (fields))) + && ANON_AGGR_TYPE_P (TREE_TYPE (fields))) dfs_push_decls (TYPE_BINFO (TREE_TYPE (fields)), data); method_vec = (CLASS_TYPE_P (type) @@ -3001,7 +3001,7 @@ dfs_unuse_fields (binfo, data) TREE_USED (fields) = 0; if (DECL_NAME (fields) == NULL_TREE - && TREE_CODE (TREE_TYPE (fields)) == UNION_TYPE) + && ANON_AGGR_TYPE_P (TREE_TYPE (fields))) unuse_fields (TREE_TYPE (fields)); } |