C requires the operands of arithmetic expressions to be promoted if
their types are smaller than an int. Ubsan emits overflow checks when
this sort of type promotion occurs, even if there is no way to actually
get an overflow with the promoted type.
This patch teaches clang how to omit the superflous overflow checks
(addressing PR20193).
Testing: check-clang and check-ubsan.
Checking isPromotableIntegerType doesn't work the way you want it to; types can be "promoted" without actually widening them. For example, enum types are promotable, and in C++ wchar_t is promotable.