C++ PATCH: PR 9965

Michael Matz matz@suse.de
Fri Mar 7 14:12:00 GMT 2003


Hi Mark,

On 6 Mar 2003, Mark Mitchell wrote:

> You're right.  The interesting thing is that both of the new problems
> have actually been in existing code that was (apparently) exercised
> rarely.
>
> The compiler has two sets of conversion machinery, and we want to switch
> to the better version, and eliminate the worse version.  Apparently the
> better version isn't monotonically better. :-(

With your later patch this is also fixed.  But now a problem pops up in
mozilla, which can be reduced to this testcase:

------ snip --------
struct Base { virtual void v() = 0;};
struct Derived : public Base { void v(); };
const Derived f();
void g()
{
    const Base & encoding = f();
}
------ snap --------

I believe this is the problem Jason was also describing.  The anon
temporary that now is constructed can't be constructed, because it's an
abstract class.  I'm not sure this is conforming code, but 3.3 branch from
some days ago did compile this, and it's excercised in mozilla.


Ciao,
Michael.



More information about the Gcc-patches mailing list