Revert "fix issue 10503 -  Octal enums don't work anymore"

This reverts commit c4be9678c9db17175512ef402753da78295ac8bd.
Revert "Revert "fix issue 10503 -  Octal enums don't work anymore""

This reverts commit fd91c8a3b7fa008c4dc70fe948d6c8923dc8f1a0.