[clang] [clang] Accept empty enum in MSVC compatible C (PR #159981)

via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 20 09:22:40 PDT 2025


yicuixi wrote:

> Thank you for working on this!
> 
> I'd like to see extra test coverage to ensure that an empty enum has the same ABI properties in Clang as it does in MSVC. e.g., the size of the enumeration is still the same as the size of an int, an object of that type is still passed as an int (no masking or other oddities), etc. So I think perhaps we should add a CodeGen test just to smoke test the behavior.
> 
> We should probably also mention the extension somewhere in clang/docs/LanguageExtensions.rst. We currently have a section for `Enumerations with a fixed underlying type`, so we could add one nearby for `Enumerations with no enumerators` or something.

Thanks for the review and sorry for the very late update. I've added a new CodeGen test.

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


More information about the cfe-commits mailing list