92th Cygnus<->FSF merge
authorMike Stump <mrs@gcc.gnu.org>
Tue, 8 Jul 1997 00:17:49 +0000 (00:17 +0000)
committerMike Stump <mrs@gcc.gnu.org>
Tue, 8 Jul 1997 00:17:49 +0000 (00:17 +0000)
From-SVN: r14401

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/method.c
gcc/cp/pt.c
gcc/cp/rtti.c
gcc/cp/tree.c
gcc/cp/typeck2.c

index 37a439e68b31f65a196534c751fa3659eb467457..90479465fab9b8e4a33cf2823b9ae4d6bb89f482 100644 (file)
@@ -1,3 +1,42 @@
+Thu Jul  3 01:44:05 1997  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * class.c (finish_struct_1): Only complain about pointers without
+       copy stuff if there are any constructors.
+
+       * rtti.c (build_dynamic_cast): Call complete_type on the types.
+
+       * decl.c (grokfndecl): If the function we chose doesn't actually
+       match, die.
+
+       * decl2.c (grokclassfn): Don't specify 'const int' for the
+       artificial destructor parm.
+
+       * pt.c (type_unification): If we are called recursively, nothing 
+       decays.
+
+Mon Jun 30 17:53:21 1997  Geoffrey Noer  <noer@cygnus.com>
+
+        * decl.c: Stop trying to catch signals other than SIGABRT
+        since the Cygwin32 library doesn't support them correctly
+        yet.  This fixes a situation in which g++ causes a hang on
+        SIGSEGVs and other such signals in our Win32-hosted tools.
+
+Mon Jun 30 14:50:01 1997  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * tree.c (mapcar, case CALL_EXPR): Handle all the parse node data.
+
+Fri Jun 27 15:18:49 1997  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * typeck2.c (store_init_value): Always return the value if our 
+       type needs constructing.
+
+       * method.c (hack_identifier): Convert class statics from
+       reference, too.
+
+Thu Jun 26 11:44:46 1997  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * Make-lang.in (cplib2.ready): Add $(LANGUAGES) dependency.
+
 Thu Jun 19 16:49:28 1997  Mike Stump  <mrs@cygnus.com>
 
        * typeck.c (c_expand_return): Make sure we clean up temporaries at
index 0dee0fd96901c30bfd90c991f68a6de644133720..62753322186aa4025cbb8d58f371cee77a36ea14 100644 (file)
@@ -3598,7 +3598,7 @@ finish_struct_1 (t, warn_anon)
     }
 
   /* Effective C++ rule 11.  */
-  if (has_pointers && warn_ecpp
+  if (has_pointers && warn_ecpp && TYPE_HAS_CONSTRUCTOR (t)
       && ! (TYPE_HAS_INIT_REF (t) && TYPE_HAS_ASSIGN_REF (t)))
     {
       cp_warning ("`%#T' has pointer data members", t);
index 5a5978c727f44f70d1e265fc8647df20375755b1..248275e2b694d48fdfe1517019446b6630a58d3b 100644 (file)
@@ -4677,6 +4677,7 @@ init_decl_processing ()
      around compiler bugs.  */
   signal (SIGSEGV, signal_catch);
 
+#ifndef __CYGWIN32__
   /* We will also catch aborts in the back-end through signal_catch and
      give the user a chance to see where the error might be, and to defeat
      aborts in the back-end when there have been errors previously in their
@@ -4693,6 +4694,13 @@ init_decl_processing ()
 #ifdef SIGBUS
   signal (SIGBUS, signal_catch);
 #endif
+#else /* ndef __CYGWIN32__ */
+  /* Cygwin32 cannot handle catching signals other than
+     SIGABRT yet.  We hope this will cease to be the case soon. */
+#ifdef SIGABRT
+  signal (SIGABRT, signal_catch);
+#endif
+#endif /* ndef __CYGWIN32__ */
 
   gcc_obstack_init (&decl_obstack);
 
@@ -7189,8 +7197,12 @@ grokfndecl (ctype, type, declarator, virtualp, flags, quals,
            }
          if (tmp && DECL_ARTIFICIAL (tmp))
            cp_error ("definition of implicitly-declared `%D'", tmp);
-         if (tmp && duplicate_decls (decl, tmp))
-           return tmp;
+         if (tmp)
+           {
+             if (!duplicate_decls (decl, tmp))
+               my_friendly_abort (892);
+             return tmp;
+           }
        }
 
       if (ctype == NULL_TREE || check)
index 229a656f26078ffeabc3dd8de97bd87ae079ff82..b4fced4a1270f6e0a7095218c4f9f945eb772746 100644 (file)
@@ -949,10 +949,9 @@ grokclassfn (ctype, cname, function, flags, quals)
   if (flags == DTOR_FLAG)
     {
       char *buf, *dbuf;
-      tree const_integer_type = build_type_variant (integer_type_node, 1, 0);
       int len = sizeof (DESTRUCTOR_DECL_PREFIX)-1;
 
-      arg_types = hash_tree_chain (const_integer_type, void_list_node);
+      arg_types = hash_tree_chain (integer_type_node, void_list_node);
       TREE_SIDE_EFFECTS (arg_types) = 1;
       /* Build the overload name.  It will look like `7Example'.  */
       if (IDENTIFIER_TYPE_VALUE (cname))
index a8502d45f43a899fcc4ae9f4f5de274978c2f583..de641d4c39365652c8d289a6db47358641581212 100644 (file)
@@ -1646,9 +1646,8 @@ hack_identifier (value, name)
                }
            }
        }
-      return value;
     }
-  if (TREE_CODE (value) == TREE_LIST && TREE_NONLOCAL_FLAG (value))
+  else if (TREE_CODE (value) == TREE_LIST && TREE_NONLOCAL_FLAG (value))
     {
       if (type == 0)
        {
index 7febfc6390d99b63c9cfdfb2a45cae19d6396ae9..291e33baa3a64ddb3ec6b5987252afc662473105 100644 (file)
@@ -2686,10 +2686,10 @@ type_unification (tparms, targs, parms, args, nsubsts, subr, strict)
          arg = TREE_TYPE (arg);
        }
 #endif
-      if (TREE_CODE (arg) == REFERENCE_TYPE)
+      if (! subr && TREE_CODE (arg) == REFERENCE_TYPE)
        arg = TREE_TYPE (arg);
 
-      if (TREE_CODE (parm) != REFERENCE_TYPE)
+      if (! subr && TREE_CODE (parm) != REFERENCE_TYPE)
        {
          if (TREE_CODE (arg) == FUNCTION_TYPE
              || TREE_CODE (arg) == METHOD_TYPE)
index 92b2c579f72ec1de10c8f95ddc258de051f02878..138432421e2a20cb7f286a4239e479bd64e4807d 100644 (file)
@@ -439,7 +439,7 @@ build_dynamic_cast (type, expr)
        goto fail;
       if (TREE_CODE (TREE_TYPE (exprtype)) != RECORD_TYPE)
        goto fail;
-      if (TYPE_SIZE (TREE_TYPE (exprtype)) == NULL_TREE)
+      if (TYPE_SIZE (complete_type (TREE_TYPE (exprtype))) == NULL_TREE)
        goto fail;
       if (TREE_READONLY (TREE_TYPE (exprtype))
          && ! TYPE_READONLY (TREE_TYPE (type)))
@@ -450,7 +450,7 @@ build_dynamic_cast (type, expr)
     case REFERENCE_TYPE:
       if (TREE_CODE (TREE_TYPE (type)) != RECORD_TYPE)
        goto fail;
-      if (TYPE_SIZE (TREE_TYPE (type)) == NULL_TREE)
+      if (TYPE_SIZE (complete_type (TREE_TYPE (type))) == NULL_TREE)
        goto fail;
       break;
       /* else fall through */
@@ -475,7 +475,7 @@ build_dynamic_cast (type, expr)
        goto fail;
       if (TREE_CODE (TREE_TYPE (exprtype)) != RECORD_TYPE)
        goto fail;
-      if (TYPE_SIZE (TREE_TYPE (exprtype)) == NULL_TREE)
+      if (TYPE_SIZE (complete_type (TREE_TYPE (exprtype))) == NULL_TREE)
        goto fail;
       if (TREE_READONLY (TREE_TYPE (exprtype))
          && ! TYPE_READONLY (TREE_TYPE (type)))
index a0605306d911d1096d9e65e7cdc277941d356647..e6c0e5008432cbd80c1e1185e5c4711c747eba85 100644 (file)
@@ -1529,7 +1529,6 @@ mapcar (t, func)
     case PREINCREMENT_EXPR:
     case POSTDECREMENT_EXPR:
     case POSTINCREMENT_EXPR:
-    case CALL_EXPR:
     case ARRAY_REF:
     case SCOPE_REF:
       t = copy_node (t);
@@ -1537,6 +1536,21 @@ mapcar (t, func)
       TREE_OPERAND (t, 1) = mapcar (TREE_OPERAND (t, 1), func);
       return t;
 
+    case CALL_EXPR:
+      t = copy_node (t);
+      TREE_TYPE (t) = mapcar (TREE_TYPE (t), func);
+      TREE_OPERAND (t, 0) = mapcar (TREE_OPERAND (t, 0), func);
+      TREE_OPERAND (t, 1) = mapcar (TREE_OPERAND (t, 1), func);
+
+      /* tree.def says that operand two is RTL, but
+        build_call_declarator puts trees in there.  */
+      if (TREE_OPERAND (t, 2)
+         && TREE_CODE (TREE_OPERAND (t, 2)) == TREE_LIST)
+       TREE_OPERAND (t, 2) = mapcar (TREE_OPERAND (t, 2), func);
+      else
+       TREE_OPERAND (t, 2) = NULL_TREE;
+      return t;
+
     case CONVERT_EXPR:
     case ADDR_EXPR:
     case INDIRECT_REF:
index afd4cd8f2050ad86f2c6a362ecd3287a6a937b23..d2a9839db9642f2feb4ae8333fa0a2d2e30d5e2b 100644 (file)
@@ -621,6 +621,11 @@ store_init_value (decl, init)
 
   if (TREE_CODE (value) == ERROR_MARK)
     ;
+  /* Other code expects that initializers for objects of types that need
+     constructing never make it into DECL_INITIAL, and passes 'init' to
+     expand_aggr_init without checking DECL_INITIAL.  So just return.  */
+  else if (TYPE_NEEDS_CONSTRUCTING (type))
+    return value;
   else if (TREE_STATIC (decl)
           && (! TREE_CONSTANT (value)
               || ! initializer_constant_valid_p (value, TREE_TYPE (value))