[llvm] [dsymutil] Fix linker's ODR uniquing for typedefs with different underlying types (PR #195749)
Peter Rong via llvm-commits
llvm-commits at lists.llvm.org
Tue May 5 10:38:47 PDT 2026
DataCorrupted wrote:
>clang doesn't currently produce any DWARF that's dependent on preferred names so far as I know
Thanks for bring the context of https://github.com/llvm/llvm-project/commit/2ff049b12ee3fb60581835a28bf9d0acc1723f23, I will have to build the prod again to find the exact source level cause.
> I /believe/ technically defining the same typedef with different definitions in different contexts is technically an ODR violation, though one that doesn't generally get diagnosed/is mostly harmless
I do no agree with this. In the test we added, three `cpp` files shared the same header, and thus had the same `typedef`. However, they don't meet until link time, meaning that this is technically valid cpp.
> that seems pretty rare? That said, "correctly" supporting this by detecting type equivalence does seem the more robust solution than fixing it just for "most" cases (where the file and line number differ)
I wouldn't say its rare since we found it in production. But I wonder what "correct" support were you thinking of?
https://github.com/llvm/llvm-project/pull/195749
More information about the llvm-commits
mailing list