[clang] [Modules] Detect ODR mismatches for enums in non-C++ like in C++. (PR #90298)

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 29 12:05:26 PDT 2024


dwblaikie wrote:

> > C doesn't have an odr, does it?
> 
> For non-C++ "ODR" has a meaning more like "ODR-inspired checks". But there is no language rule that would require enforcement and there is no impact on linkage (at least during deserialization).

Not sure I'm following the response here - but I guess what I'm trying to say, with more words, is that my understanding was that C doesn't have an ODR, and you can have different definitions of a type, with the same name, in C and that's OK.

And it sounds like this change makes that not OK in some way? (either by diagnosing/erroring on such divergent types, or assuming they won't diverge and carrying on silently)

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


More information about the cfe-commits mailing list