This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [gimple-classes, committed 4/6] tree-ssa-tail-merge.c: Use gassign
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: David Malcolm <dmalcolm at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, GCC Development <gcc at gcc dot gnu dot org>, Jeff Law <law at redhat dot com>
- Date: Thu, 13 Nov 2014 10:59:13 +0000
- Subject: Re: [gimple-classes, committed 4/6] tree-ssa-tail-merge.c: Use gassign
- Authentication-results: sourceware.org; auth=none
- References: <1415373690-26193-1-git-send-email-dmalcolm at redhat dot com> <1415373690-26193-5-git-send-email-dmalcolm at redhat dot com> <CAFiYyc2rg+T5d7rkTBPLeWKGnWMgv07j_N8KaFfr0NK1CjsfVQ at mail dot gmail dot com> <CAFiYyc2Y4uWt3Ec-D=c+LmKyBb1s0UPkP=8sSr1+5_nb7NruyA at mail dot gmail dot com> <20141108135646 dot GU5026 at tucnak dot redhat dot com> <1415658470 dot 2209 dot 20 dot camel at surprise> <20141111072614 dot GW5026 at tucnak dot redhat dot com> <CAFiYyc1jfx05qxvsCGqbdDL=ouH0hMp2A1ufandUbb-EfUAukg at mail dot gmail dot com> <1415842862 dot 2209 dot 101 dot camel at surprise> <CAFiYyc0H958TKBOb7F20hg8++YnOQYeMcQEZ2Ba+Q0F6hobeKw at mail dot gmail dot com>
On 13 November 2014 10:45, Richard Biener wrote:
>
> Hmm.
>
> struct assign;
> struct base {
> operator assign *() const { return (assign *)this; }
> };
> struct assign : base {
> };
>
> void foo (assign *);
> void bar (base *b)
> {
> foo (b);
> }
>
> doesn't work, but
>
> void bar (base &b)
> {
> foo (b);
> }
>
> does. Indeed C++ doesn't seem to provide what is necessary
> for the compat trick :(
Right, base* is a built-in type, you can't call a member function on it.
There is no implicit conversion between unrelated pointer types, and
no implicit conversion from base* to base& that would be necessary to
call the conversion operator of base.