Commit 52bf7d5d by Mark Mitchell Committed by Mark Mitchell

error.c (dump_decl): Deal with TEMPLATE_DECLs that are VAR_DECLs.

	* error.c (dump_decl): Deal with TEMPLATE_DECLs that are
	VAR_DECLs.  Handle vtables whose DECL_CONTEXT is not a type.
	* class.c (finish_struct_1): Use build_cplus_array_type to build
	array types.
	* decl.c (init_decl_processing): Likewise.
	* except.c (expand_end_eh_spec): Likewise.
	* search.c (expand_upcast_fixups): Simplify very slightly.

From-SVN: r23359
parent ad3ef78e
1998-10-26 Mark Mitchell <mark@markmitchell.com>
* error.c (dump_decl): Deal with TEMPLATE_DECLs that are
VAR_DECLs. Handle vtables whose DECL_CONTEXT is not a type.
* class.c (finish_struct_1): Use build_cplus_array_type to build
array types.
* decl.c (init_decl_processing): Likewise.
* except.c (expand_end_eh_spec): Likewise.
* search.c (expand_upcast_fixups): Simplify very slightly.
1998-10-26 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (grokdeclarator): Complain about a variable using
......
......@@ -4155,7 +4155,7 @@ finish_struct_1 (t, warn_anon)
{
/* Use size_int so values are memoized in common cases. */
tree itype = build_index_type (size_int (has_virtual));
tree atype = build_array_type (vtable_entry_type, itype);
tree atype = build_cplus_array_type (vtable_entry_type, itype);
layout_type (atype);
......
......@@ -6208,7 +6208,7 @@ init_decl_processing ()
record_builtin_type (RID_MAX, VTBL_PTR_TYPE, vtable_entry_type);
vtbl_type_node
= build_array_type (vtable_entry_type, NULL_TREE);
= build_cplus_array_type (vtable_entry_type, NULL_TREE);
layout_type (vtbl_type_node);
vtbl_type_node = build_qualified_type (vtbl_type_node, TYPE_QUAL_CONST);
record_builtin_type (RID_MAX, NULL_PTR, vtbl_type_node);
......
......@@ -729,7 +729,13 @@ dump_decl (t, v)
if (DECL_NAME (t) && VTABLE_NAME_P (DECL_NAME (t)))
{
OB_PUTS ("vtable for ");
dump_type (DECL_CONTEXT (t), v);
if (TYPE_P (DECL_CONTEXT (t)))
dump_type (DECL_CONTEXT (t), v);
else
/* This case can arise with -fno-vtable-thunks. See
expand_upcast_fixups. It's not clear what to print
here. */
OB_PUTS ("{unknown type}");
break;
}
/* else fall through */
......@@ -863,6 +869,8 @@ dump_decl (t, v)
if (TREE_CODE (DECL_TEMPLATE_RESULT (t)) == TYPE_DECL)
dump_type (TREE_TYPE (t), v);
else if (TREE_CODE (DECL_TEMPLATE_RESULT (t)) == VAR_DECL)
dump_decl (DECL_TEMPLATE_RESULT (t), v);
else if (TREE_TYPE (t) == NULL_TREE)
my_friendly_abort (353);
else switch (NEXT_CODE (t))
......
......@@ -774,7 +774,7 @@ expand_end_eh_spec (raises)
TREE_HAS_CONSTRUCTOR (types) = 1;
/* We can't pass the CONSTRUCTOR directly, so stick it in a variable. */
tmp = build_array_type (const_ptr_type_node, NULL_TREE);
tmp = build_cplus_array_type (const_ptr_type_node, NULL_TREE);
decl = build_decl (VAR_DECL, NULL_TREE, tmp);
DECL_ARTIFICIAL (decl) = 1;
DECL_INITIAL (decl) = types;
......
......@@ -2542,7 +2542,7 @@ expand_upcast_fixups (binfo, addr, orig_addr, vbase, vbase_addr, t,
/* Dup it if it isn't in local scope yet. */
nvtbl = build_decl
(VAR_DECL, DECL_NAME (vtbl),
TYPE_MAIN_VARIANT (TREE_TYPE (BINFO_VTABLE (binfo))));
TYPE_MAIN_VARIANT (TREE_TYPE (vtbl)));
DECL_ALIGN (nvtbl) = MAX (TYPE_ALIGN (double_type_node),
DECL_ALIGN (nvtbl));
TREE_READONLY (nvtbl) = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment