Allow constant c-like enum to integral/float cast

Fix #4926