xeus icon indicating copy to clipboard operation
xeus copied to clipboard

RTTI is required

Open wolfv opened this issue 1 year ago • 1 comments

I was upgrading LFortran to use the latest xeus. LFortran (by default) adds a -fno-rtti flag. This crashes in the dynamic_cast<xcontext_impl<T>*>(this);.

Would a static_cast<...> instead work?

wolfv avatar Aug 08 '22 04:08 wolfv

I can confirm that a static_cast<...> works. I guess we loose the type check.

wolfv avatar Aug 08 '22 04:08 wolfv

This (the dynamic_cast) is something we want to keep, especially now that the instantiation of the context is done in external libraries. It has been replaced with a static_cast for now, because of hidden symbols issues, but it should be restored in the next major release.

JohanMabille avatar Jun 02 '23 07:06 JohanMabille