Skip to content

[BUG] enum should be trivial #1435

Description

@mrizaln

Enumeration in C++1 is trivial; it should be trivial in C++2 as well.

// cpp1
enum class Foo { A, B, C, };

// cpp2
Bar: @enum type = { A; B; C; }


main: () = {
    static_assert(std::is_trivial_v<Foo>, "Foo is not trivial D:");     // ok
    static_assert(std::is_trivial_v<Bar>, "Bar is not trivial D:");     // not ok
}

Activity

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions