summaryrefslogtreecommitdiff
path: root/gcc/cp/cvt.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1997-12-15 07:24:29 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1997-12-15 07:24:29 +0000
commitfc9fc8d8ed6461f75d9156c9e8570c1351a4e403 (patch)
tree03592c4cfb777f6578fc5f57fc525f2370c5e85c /gcc/cp/cvt.c
parentc4fa4c4d9fccf5c27b3607881dc2c8b6bd4f00e7 (diff)
downloadgcc-fc9fc8d8ed6461f75d9156c9e8570c1351a4e403.tar.gz
* cvt.c (cp_convert_to_pointer): Fix base conversion of pm's.
* pt.c (type_unification_real): Change __null to type void* with a warning. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17098 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r--gcc/cp/cvt.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index 29964928005..fdfdb7f2790 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -258,11 +258,19 @@ cp_convert_to_pointer (type, expr)
{
tree b1 = TYPE_OFFSET_BASETYPE (TREE_TYPE (type));
tree b2 = TYPE_OFFSET_BASETYPE (TREE_TYPE (intype));
- tree binfo = get_binfo (b1, b2, 1);
+ tree binfo = get_binfo (b2, b1, 1);
+ enum tree_code code = PLUS_EXPR;
+
if (binfo == NULL_TREE)
- binfo = get_binfo (b2, b1, 1);
+ {
+ binfo = get_binfo (b1, b2, 1);
+ code = MINUS_EXPR;
+ }
+
if (binfo == error_mark_node)
return error_mark_node;
+ if (binfo && ! TREE_VIA_VIRTUAL (binfo))
+ expr = size_binop (code, expr, BINFO_OFFSET (binfo));
}
if (TREE_CODE (TREE_TYPE (intype)) == METHOD_TYPE