Allow c-like enum to integral/float cast

Fix #4926