Fix a handful of ICEs around casting

This fixes missing cases in trans for various casts that are permitted by typeck.  I wasn't sure whether some of these were actually intended to be allowed (e.g. enum -> pointer), so each commit is a self-contained change that can easily be dropped if necessary.

Closes issue #17458 
Closes issue #17444