This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH: typedefs breaking conversions
- To: Jason Merrill <jason at cygnus dot com>
- Subject: Re: C++ PATCH: typedefs breaking conversions
- From: Nathan Sidwell <nathan at acm dot org>
- Date: Thu, 01 Apr 1999 10:05:51 +0100
- CC: nathan at compsci dot bristol dot ac dot uk, egcs-patches at egcs dot cygnus dot com, Martin von Loewis <loewis at informatik dot hu-berlin dot de>
- Organization: University of Bristol
- References: <37020ACA.27017A5F@acm.org> <u9677hmono.fsf@yorick.cygnus.com>
- Reply-To: nathan at compsci dot bristol dot ac dot uk
Jason Merrill wrote:
>
> This one shouldn't be necessary; TYPE_MAIN_VARIANTs can be compared with
> ==.
Then something's gone wrong with TYPE_MAIN_VARIANT. Martin's test case was
typedef int Int;
int *p;
Int *&pr2 = p;
'Int *' and 'int *' are the same type (7.1.3/1), so comp_target_types should
return 1. However, after extracting the TYPE_MAIN_VARIANTs, we (still) have
ttl -> Int *
ttr -> int *
ttl = 0x327cb0
ttr = 0x315d78
What happens is that build_pointer_type (gcc/tree.c), constructs a pointer to
`Int' and labels it as its own main variant. This is wrong, because the pointed
to type is a typedef. build_reference_type has the same behaviour, and I'd
guess the assumption is in other places too. Because this is grunging around in
rather a core part of the compiler, I don't feel qualified to attack the
problem.
In the meantime, I withdraw the entire patch (but not the testcase), as the
problem in convert_pointer_to_real is the same.
nathan
--
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
You can up the bandwidth, but you can't up the speed of light
nathan@acm.org http://www.cs.bris.ac.uk/~nathan/ nathan@cs.bris.ac.uk