* typeck.c (mark_addressable): Never set TREE_USED.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 Jul 2000 21:35:46 +0000 (21:35 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 Jul 2000 21:35:46 +0000 (21:35 +0000)
        * call.c (build_call): Don't abort on calls to library functions
        that have been declared normally.

        * typeck.c (build_binary_op): Fix grammar in warning.

        * exception.cc (__eh_free): Fix prototype.

        * decl2.c (finish_decl_parsing): Handle TEMPLATE_ID_EXPR.

        * decl.c (pushdecl): Handle seeing an OVERLOAD in
        IDENTIFIER_NAMESPACE_VALUE.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35104 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/exception.cc
gcc/cp/typeck.c

index 97c6763..6a592a4 100644 (file)
@@ -1,3 +1,18 @@
+2000-07-17  Jason Merrill  <jason@redhat.com>
+
+       * typeck.c (mark_addressable): Never set TREE_USED.
+       * call.c (build_call): Don't abort on calls to library functions
+       that have been declared normally.
+
+       * typeck.c (build_binary_op): Fix grammar in warning.
+
+       * exception.cc (__eh_free): Fix prototype.
+
+       * decl2.c (finish_decl_parsing): Handle TEMPLATE_ID_EXPR.
+
+       * decl.c (pushdecl): Handle seeing an OVERLOAD in 
+       IDENTIFIER_NAMESPACE_VALUE.
+
 2000-07-14  Zack Weinberg  <zack@wolery.cumb.org>
 
        * .cvsignore: parse.h and parse.c have no cp- prefix.
index 48ce6fb..4a68f57 100644 (file)
@@ -397,8 +397,11 @@ build_call (function, parms)
 
   if (decl && ! TREE_USED (decl))
     {
-      /* We invoke build_call directly for several library functions.  */
-      if (DECL_ARTIFICIAL (decl))
+      /* We invoke build_call directly for several library functions.
+        These may have been declared normally if we're building libgcc,
+        so we can't just check DECL_ARTIFICIAL.  */
+      if (DECL_ARTIFICIAL (decl)
+         || !strncmp (IDENTIFIER_POINTER (DECL_NAME (decl)), "__", 2))
        mark_used (decl);
       else
        my_friendly_abort (990125);
index 1f49ae6..f8c5ff2 100644 (file)
@@ -4019,15 +4019,12 @@ pushdecl (x)
        {
          tree decl;
 
-         if (IDENTIFIER_NAMESPACE_VALUE (name) != NULL_TREE
-             && IDENTIFIER_NAMESPACE_VALUE (name) != error_mark_node
-             && (DECL_EXTERNAL (IDENTIFIER_NAMESPACE_VALUE (name))
-                 || TREE_PUBLIC (IDENTIFIER_NAMESPACE_VALUE (name))))
-           decl = IDENTIFIER_NAMESPACE_VALUE (name);
-         else
-           decl = NULL_TREE;
+         decl = IDENTIFIER_NAMESPACE_VALUE (name);
+         if (decl && TREE_CODE (decl) == OVERLOAD)
+           decl = OVL_FUNCTION (decl);
 
-         if (decl
+         if (decl && decl != error_mark_node
+             && (DECL_EXTERNAL (decl) || TREE_PUBLIC (decl))
              /* If different sort of thing, we already gave an error.  */
              && TREE_CODE (decl) == TREE_CODE (x)
              && !same_type_p (TREE_TYPE (x), TREE_TYPE (decl)))
index 600cfce..64a09c0 100644 (file)
@@ -4310,6 +4310,8 @@ finish_decl_parsing (decl)
       /* For attribute handling.  */
       TREE_VALUE (decl) = finish_decl_parsing (TREE_VALUE (decl));
       return decl;
+    case TEMPLATE_ID_EXPR:
+      return decl;
     default:
       my_friendly_abort (5);
       return NULL_TREE;
index 1ffd762..886915c 100644 (file)
@@ -120,7 +120,7 @@ extern "C" cp_eh_info **__get_eh_info ();   // actually void **
 
 /* Exception allocate and free, defined in libgcc2. */
 extern "C" void *__eh_alloc(size_t);
-extern "C" void __eh_free();
+extern "C" void __eh_free(void *);
 
 /* Is P the type_info node for a pointer of some kind?  */
 
index a12ebe9..c85e3d1 100644 (file)
@@ -3963,7 +3963,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
                                                signed_type (result_type)))))
            /* OK */;
          else
-           warning ("comparison between a signed and an unsigned integer expressions");
+           warning ("comparison between signed and unsigned integer expressions");
 
          /* Warn if two unsigned values are being compared in a size
             larger than their original size, and one (and only one) is the
@@ -4969,21 +4969,12 @@ mark_addressable (exp)
          cp_warning ("address requested for `%D', which is declared `register'",
                      x);
        TREE_ADDRESSABLE (x) = 1;
-       TREE_USED (x) = 1;
        if (cfun && expanding_p)
          put_var_into_stack (x);
        return 1;
 
       case FUNCTION_DECL:
-       /* We have to test both conditions here.  The first may be
-          non-zero in the case of processing a default function.  The
-          second may be non-zero in the case of a template function.  */
-       if (DECL_LANG_SPECIFIC (x)
-           && DECL_TEMPLATE_INFO (x) 
-           && !DECL_TEMPLATE_SPECIALIZATION (x))
-         mark_used (x);
        TREE_ADDRESSABLE (x) = 1;
-       TREE_USED (x) = 1;
        TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (x)) = 1;
        return 1;