I haven't found a way to typecast where bitwise assignment operation (e.g. x |= y &z;) is involved.
Example:
#include <stdio.h>
typedef enum type1{
AA = 0,
BB = 1
} type1_e;
int main()
{
type1_e x,y;
y = type1_e(y | x); //working
y |= (type1_e)(y|x); //ERROR: as.cc:15: error: invalid conversion from ‘int’ to ‘type1_e’
}