error.c (dump_decl): Deal with TEMPLATE_DECLs that are VAR_DECLs.
authorMark Mitchell <mark@markmitchell.com>
Mon, 26 Oct 1998 23:48:58 +0000 (23:48 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Mon, 26 Oct 1998 23:48:58 +0000 (23:48 +0000)
* 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

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/decl.c
gcc/cp/error.c
gcc/cp/except.c
gcc/cp/search.c

index 55065688452499c6d218902c2a3a5ad384cb67b9..8c3123b393554fa2e7d234e7f9cbd1816f4273d4 100644 (file)
@@ -1,3 +1,14 @@
+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
index 8141db183419375ff721cf4b573c261998f3919a..6245700de6ea780f3816d17565a808af87b2c66e 100644 (file)
@@ -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);
 
index f5167467e4f5743bc11fe104d653c896ee4e4a11..87b8d5081121505bb9508bd6955238b5d18e7527 100644 (file)
@@ -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);
index 002473a781bfdb4c1febb871ac2e728ef4a1d155..bd7d178879eb39a3695ae0e576fd2dc7d4981ccf 100644 (file)
@@ -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))
index c21ac240eff2d591828e8c035de33f2387f91edf..2d069dac6fd290343690327bb741c493b3209795 100644 (file)
@@ -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;
index 5af1c7d67c4e3900ed03457addda011b14446bc4..c49fd2268d49df4f6209ee5ae5c326cd7b34bfb8 100644 (file)
@@ -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;