https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97908

--- Comment #1 from Jan Engelhardt <jengelh at inai dot de> ---
On second thought, this is practically the same issue as functions going away
(like example below), so wontfix seems appropriate.

-- main
#include <dlfcn.h>
struct base { virtual ~base() {}; };
int main()
{
        auto hnd = dlopen("./libx.so", RTLD_NOW);
        auto f = reinterpret_cast<base *(*)()>(dlsym(hnd, "makederiv"));
        auto deriv = f();
        dlclose(hnd);
        delete deriv;
}
-- libx
#include <typeinfo>
struct base { virtual ~base() {}; }
struct deriv : base { virtual ~deriv() {}; }
extern "C" { base *makederiv(); }
base *makederiv() { return new deriv; }

Reply via email to