Skip to content

#embed incorrectly assumes numbers are negative #119256

@StreetwareGames

Description

@StreetwareGames

very hard to reproduce as I have no idea what triggers it. it should never ever happen though.

static constexpr unsigned char data[] = {
#if __has_embed("data.bin")
#embed "data.bin"
#endif
};

error: constexpr initializer evaluates to -41 which is not exactly representable in type 'const unsigned char'

Metadata

Metadata

Assignees

No one assigned

    Labels

    c23clang:frontendLanguage frontend issues, e.g. anything involving "Sema"constexprAnything related to constant evaluationembed#embed (not embedded systems)

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions