Skip to content

Clang does not warn about assignment to an undersized bit field vs. preferred type #116760

@ojhunt

Description

@ojhunt

A problem I've hit in the llvm+clang is failure to identify undersized bitfields used to store enums. While clang does emit a warning for this directly, llvm uses raw integer field types for bitfields (apparently due to msvc failing to pack bitfields of different types :-/).

To mitigate this during debugging we use the preferred-type attribute to inform the debugging metadata, but we don't use it for any actual semantic checks, we should rectify this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions