[libcxx-commits] [libcxx] [libc++] Disables -Wweak-vtables diagnostics. (PR #85577)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 20 09:57:09 PDT 2024


================
@@ -27,6 +27,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 template <class _Err>
 class bad_expected_access;
 
+_LIBCPP_DIAGNOSTIC_PUSH
+_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wweak-vtables")
----------------
philnik777 wrote:

> AFAIK We only use weak symbols for the replaceable functions and some debug functions. Not for other functions. I'm not sure whether we want do that. It would allow users to provide strong definitions of destructors they should not provide.

inline symbols have weak linkage, we don't have to give that explicitly. You can see that in https://godbolt.org/z/a3P4P7qhE. The `.weak test()` gives `test()` weak linkage, and explicitly giving it weak linkage doesn't make any difference.

> I can't find the example you mean, do you mean the templates guarded by `_LIBCPP_AVAILABILITY_HAS_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1` ?

Yes.


https://github.com/llvm/llvm-project/pull/85577


More information about the libcxx-commits mailing list