[cfe-dev] How to tell whether two TypeDecls are implicit convertible to each other?
Ray Zhang via cfe-dev
cfe-dev at lists.llvm.org
Mon Jun 15 12:15:17 PDT 2020
Thank you so much! I was not aware of the cast kind enums that were
available - this helps me a ton.
On Mon, Jun 15, 2020 at 9:04 AM Miklos Vajna <vmiklos at vmiklos.hu> wrote:
> 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
> > 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 --------------
An HTML attachment was scrubbed...
More information about the cfe-dev