pcc added a comment. This change ensures that __func receives public LTO visibilty: https://clang.llvm.org/docs/LTOVisibility.html if a translation unit is compiled with `-fvisibility=hidden` and without `_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS` defined (i.e. dynamically linking against libc++).
What that means is that the control flow integrity and whole-program devirtualization features are disabled on the virtual calls on __func that are used to implement operator() on std::function. Enabling those features would be incorrect because libc++ is being linked dynamically and therefore the compiler does not have full visibility of all derived classes of __func and the calls cannot be devirtualized. Repository: rCXX libc++ https://reviews.llvm.org/D48680 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits