Skip to content

Enum discriminants are not checked for their repr's numeric limits. #3353

Open
@nobel-sh

Description

@nobel-sh
enum Foo{
    Bar = 99999999999999999999999999999999999999999999999999999999,
    Qaz,
    Quax,
}

#[repr(u8)]
enum Bar{
    Qaz = 256,
    Quax = -1,
}

fn main(){}

This code passes without any errors in gccrs.
Link: https://godbolt.org/z/M54P3h3Y1

Activity

nobel-sh

nobel-sh commented on Jan 6, 2025

@nobel-sh
ContributorAuthor

Not certain but this might be related to #3352.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Enum discriminants are not checked for their repr's numeric limits. · Issue #3353 · Rust-GCC/gccrs