Say I have
enum Foo { Foo0, Foo1, Foo2 };
Note that no explicitly declared Foo constant has the value 3 (they are 0, 1, and 2).
Does the following invoke undefined behavior?
Foo yay = (Foo) 3;
Note expecially that 3
might fit into the internal representation of Foo
.