This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ Patch/RFC] Final part of c++/26099, __is_convertible_to


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]