[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
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 195 bytes
Desc: Digital signature
More information about the cfe-dev