Copied from https://reviews.llvm.org/D33672
Fixed some issues from previous revision
This checker implements a solution to the "INT50-CPP. Do not cast to an out-of-range enumeration value" rule. See https://www.securecoding.cert.org/confluence/display/cplusplus/INT50-CPP.+Do+not+cast+to+an+out-of-range+enumeration+value .