This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH to implement explicit conversion operators
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>, Benjamin Kosnik <bkoz at redhat dot com>
- Date: Sat, 16 Jan 2010 08:44:38 -0800
- Subject: Re: C++ PATCH to implement explicit conversion operators
- References: <4A11D8E0.5030009@redhat.com>
On Mon, May 18, 2009 at 1:53 PM, Jason Merrill <jason@redhat.com> wrote:
> I thought this was going to be simpler than it turned out to be. Allowing
> explicit on conversion ops and then checking the flag on them wasn't enough,
> because we were only handling LOOKUP_ONLYCONVERTING properly in cases where
> we are calling a constructor directly. Extending this to support
> direct-initialization using explicit conversion ops required me to add a
> flags parm to a bunch more functions, and choose whether or not to set
> LOOKUP_ONLYCONVERTING at the point where we ask for the conversion rather
> than lower down.
>
> After I got this working, I noticed that explicit conversion ops to class
> type were still broken; this turns out to be a bug in the specification
> which will need to be fixed before C++0x is ready. ?For the moment I've
> worked around this by treating all conversions for the first parameter of a
> copy constructor as direct-initialization; look for the word "hack" in the
> patch.
>
> Tested x86_64-pc-linux-gnu, applied to trunk.
>
This caused:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42766
--
H.J.