[C++ Patch/RFC] Final part of c++/26099, __is_convertible_to
Mark Mitchell
mark@codesourcery.com
Wed Jul 4 00:38:00 GMT 2007
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.
Sorry,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
More information about the Gcc-patches
mailing list