aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBrendan Kehoe <brendan@lisa.cygnus.com>1995-07-01 15:12:57 +0000
committerMike Stump <mrs@gcc.gnu.org>1995-07-01 15:12:57 +0000
commit42783eabe802fc6312038934e3c3c5e13e66f266 (patch)
tree9a23c7011827673de62ef69c64e7a5371e1867e1 /gcc
parente18923b4ee09a3493f5f2a7c93321b5b04e831af (diff)
downloadgcc-42783eabe802fc6312038934e3c3c5e13e66f266.zip
gcc-42783eabe802fc6312038934e3c3c5e13e66f266.tar.gz
gcc-42783eabe802fc6312038934e3c3c5e13e66f266.tar.bz2
call.c (convert_harshness): Add QUAL_CODE when we're faced with const vs non-const for void conversions.
* call.c (convert_harshness): Add QUAL_CODE when we're faced with const vs non-const for void conversions. From-SVN: r10100
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/call.c10
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 38e70fb..b650f97 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 6b0f63b..765e8fe 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -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;
}