This is the mail archive of the 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]

[C++ Patch] Implement __is_convertible_to

Hi all, hi Jason,

thus, this is my current best try at the code I have been working on the
last days. Actually, most of the changes are pretty straightforward, but
compared to the previous drafts I made efforts to decouple as much as
possible the implementation from the existing functionalities of the C++
front-end: now I'm pretty sure now that we should not be at risk of
creating regressions elsewhere outside __is_convertible_to. Anyway, the
patch as-is regtests ok, in the library too, where we have a good amount
of additional testcases for std::is_convertible, also exercising corner
cases pointed out by Howard time ago. What else... I wish I could figure
out something a little less "low level" than exploiting
force_target_expr, but everything else I tried failed, in particular
compile-time errors when the from type has deleted constructors, etc
(with force_target_expr we get, properly, correct boolean values for the
trait, no compile-time errors, as far as I can see). Also note that the
trait_is_convertible_to function itself lives in call.c, not in
semantics.c, due to its use of facilities, like convert_like_real, local
to that file.

Tested x86_64-linux. Is the patch Ok for mainline?



Attachment: CL_is_convertible_to
Description: Text document

Attachment: patch_is_convertible_to_draft_4
Description: Text document

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