Skip to content

[Clang] Add support for /Zc:enumTypes compiler flag in MSVC mode #120759

@Saalvage

Description

@Saalvage

MSVC used to have a bug where enums always had the implicit underlying type of int , independently of the enum's items. This bug is accomodated for within clang's MSVC compatibility mode, while the fix for it (the /Zc:enumTypes flag) is not.

The issue with this is that this results in information being lost for the enum's items (as they are trimmed to fit the underlying type), so fixing this on the application side would likely require reparsing the items.

I believe this might potentially be a good fit for an option in LangOptions.def?

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"diverges-from:msvcDoes the clang frontend diverge from msvc on this issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions