This is the mail archive of the
gcc-patches@gcc.gnu.org
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 18:38:42 -0700
- Subject: Re: [C++ Patch/RFC] Final part of c++/26099, __is_convertible_to
- References: <467DA755.4040600@suse.de> <468AEACE.9050801@codesourcery.com> <468AEDA6.4070201@suse.de>
Paolo Carlini wrote:
>> 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.
> I know it's optional, but if expr == NULL_TREE then
> build_user_type_conversion_1 is not called and certainly things will not
> work.
I see no inherent reason why we don't call build_user_type_conversion_1
when expr == NULL_TREE; I expect that when we expr == NULL_TREE, we must
know that we don't have class types involved. But, yes, this would have
to change, and, yes, you may need a dummy object at some point. But,
creating it later (in build_user_type_conversion_1, for example) would
be better because at least you would not create dummy objects for easy
conversions. And, if you do need a dummy object, you should be using
build_dummy_object.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713