[PATCH] D38599: Remove warnings for dynamic_cast fallback.

Dan Albert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 9 17:25:09 PDT 2017


danalbert added a comment.

> Are you 100% sure that you're not just a person with broken code?

Absolutely, since it isn't my code ;) I maintain the toolchain and this is a behavioral change when switching from libstdc++ to libc++.

> In other words, what did this guy from 2013 get wrong? -- or, if "he got nothing wrong", then why can't you just follow his advice to eliminate the duplicate typeinfos from your code? http://www.russellmcc.com/posts/2013-08-03-rtti.html

That post is all about binaries that were built with hidden visibility and says nothing about the case of `dlopen`. There's nothing wrong with the code as built. All the symbols have public visibility, all the `type_infos` are weak, everything works correctly if you explicitly link the libraries to the final executable or `dlopen` only one library (not always an option).

If anyone is still skeptical, libsupc++ went through this at one point too and eventually decided to use `strcmp` by default because otherwise RTTI doesn't work in plugin architectures (which is essentially what JNI is). https://gcc.gnu.org/ml/gcc-patches/2009-07/msg01239.html


Repository:
  rL LLVM

https://reviews.llvm.org/D38599





More information about the cfe-commits mailing list