[clang] Warn when unique objects might be duplicated in shared libraries (PR #117622)

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 16 05:15:14 PST 2025


https://github.com/zmodem commented:

Some scattered thoughts:

- What about code that's not going into a shared library. Should we disable the warning then, or is the idea that the user does not enable the warning flag in that case?

- The new warning is DefaultIgnore. Do you figure it's too noisy to be on by default, or to be in some category like -Wextra? If it's just DefaultIgnore, users are unlikely to find it.

> The check is also disabled inside templates, since it can give false positives if a template is never instantiated.

Would warning during instantiation work, or is that also too noisy?

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


More information about the cfe-commits mailing list