* search.c (get_base_distance): Remove assert.
* decl2.c (build_anon_union_vars): Don't process a field with no
name.
(finish_anon_union): Also complain about local anon unions with no
members.
From-SVN: r22597
+1998-09-25 Jason Merrill <jason@yorick.cygnus.com>
+
+ * search.c (get_base_distance): Remove assert.
+
+ * decl2.c (build_anon_union_vars): Don't process a field with no
+ name.
+ (finish_anon_union): Also complain about local anon unions with no
+ members.
+
1998-09-25 Martin von Löwis <loewis@informatik.hu-berlin.de>
* decl.c (lookup_namespace_name): If the name is a namespace,
if (!decl)
continue;
}
+ else if (DECL_NAME (field) == NULL_TREE)
+ continue;
else
{
decl = build_decl (VAR_DECL, DECL_NAME (field), TREE_TYPE (field));
main_decl = build_anon_union_vars (anon_union_decl, &elems,
static_p, external_p);
+ if (main_decl == NULL_TREE)
+ {
+ warning ("anonymous union with no members");
+ return;
+ }
+
if (static_p)
{
- if (main_decl)
- {
- make_decl_rtl (main_decl, 0, toplevel_bindings_p ());
- DECL_RTL (anon_union_decl) = DECL_RTL (main_decl);
- }
- else
- {
- warning ("anonymous union with no members");
- return;
- }
+ make_decl_rtl (main_decl, 0, toplevel_bindings_p ());
+ DECL_RTL (anon_union_decl) = DECL_RTL (main_decl);
}
/* The following call assumes that there are never any cleanups
return -3;
/* If they gave us the real vbase binfo, which isn't in the main binfo
- tree, deal with it. */
+ tree, deal with it. This happens when we are called from
+ expand_upcast_fixups. */
if (rval == -1 && TREE_CODE (parent) == TREE_VEC
&& parent == binfo_member (BINFO_TYPE (parent),
CLASSTYPE_VBASECLASSES (type)))
{
- my_friendly_abort (980901);
my_friendly_assert (BINFO_INHERITANCE_CHAIN (parent) == binfo, 980827);
new_binfo = parent;
rval = 1;