cppfront icon indicating copy to clipboard operation
cppfront copied to clipboard

[BUG] enum should be trivial

Open mrizaln opened this issue 2 months ago • 0 comments

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
}

mrizaln avatar Oct 30 '25 09:10 mrizaln