call.c (convert_harshness): Add QUAL_CODE when we're faced with const vs non-const...
authorBrendan Kehoe <brendan@lisa.cygnus.com>
Sat, 1 Jul 1995 15:12:57 +0000 (15:12 +0000)
committerMike Stump <mrs@gcc.gnu.org>
Sat, 1 Jul 1995 15:12:57 +0000 (15:12 +0000)
        * call.c (convert_harshness): Add QUAL_CODE when we're faced with
        const vs non-const for void conversions.

From-SVN: r10100

gcc/cp/ChangeLog
gcc/cp/call.c

index 38e70fb0329f6a69403bce99efc9b1de45545d1a..b650f974aec65ef252f0eed63c1755b17e8019da 100644 (file)
@@ -1,3 +1,8 @@
+Fri Jun 30 13:45:51 1995  Brendan Kehoe  <brendan@lisa.cygnus.com>
+
+       * call.c (convert_harshness): Add QUAL_CODE when we're faced with
+       const vs non-const for void conversions.
+
 Thu Jun 29 09:35:05 1995  Mike Stump  <mrs@cygnus.com>
 
        * decl.c (BOOL_TYPE_SIZE): Fix broken SLOW_BYTE_ACCESS check.
index 6b0f63b0ebf99d569fbe82b572b3b2de3d53fce8..765e8feb486d07b9f672991a480f26fc2c67289f 100644 (file)
@@ -523,7 +523,17 @@ convert_harshness (type, parmtype, parm)
          h.distance = CLASSTYPE_MAX_DEPTH (ttr)+1;
          return h;
        }
+
       h.code = penalty ? STD_CODE : PROMO_CODE;
+      /* Catch things like `const char *' -> `const void *'
+        vs `const char *' -> `void *'.  */
+      if (ttl != ttr)
+       {
+         tree tmp1 = TREE_TYPE (type), tmp2 = TREE_TYPE (parmtype);
+         if ((TYPE_READONLY (tmp1) != TREE_READONLY (tmp2))
+             || (TYPE_VOLATILE (tmp1) != TYPE_VOLATILE (tmp2)))
+           h.code |= QUAL_CODE;
+       }
       return h;
     }