This is the mail archive of the
mailing list for the GCC project.
Re: [C++ Patch/RFC] Final part of c++/26099, __is_convertible_to
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 03 Jul 2007 17:33:18 -0700
- Subject: Re: [C++ Patch/RFC] Final part of c++/26099, __is_convertible_to
- References: <467DA755.firstname.lastname@example.org>
Paolo Carlini wrote:
> after many false starts and red herrings during the last weeks, I'm
> pursuing this approach for implementing __is_convertible_to: basically,
> I'm calling the usual perform_implicit_conversion (normally used by the
> compiler when doing semantics for code like 'test' in N2255) in a
> special "simulation" context, where output of every diagnostic is
> suppressed while errors are noticed anyway.
This is clever, but I don't think it's a good approach. I think we have
to do the same kind of thing that we do for SFINAE: pass down a
parameter saying whether to issue errors or not.
I think you should also avoid the dummy expression. It would be better
just to call implicit_conversion and check that the return value is
non-NULL. Note that the EXPR argument to implicit_conversion is optional.
(650) 331-3385 x713