[cfe-dev] How to tell whether two TypeDecls are implicit convertible to each other?

Miklos Vajna via cfe-dev cfe-dev at lists.llvm.org
Mon Jun 15 09:04:43 PDT 2020


Hi Ray,

On Thu, Jun 11, 2020 at 11:59:18PM -0700, Ray Zhang via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> In order to safely change C-style casts to static_cast, we want to be able
> to tell whether two types are convertible to each other.

If you already have access to an ExplicitCastExpr, try using
getCastKind(): CK_BaseToDerived would be when you can safely replace
your C cast with a static_cast, I guess.

Regards,

Miklos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200615/dde1a521/attachment.sig>


More information about the cfe-dev mailing list