-Wenum-compare warns if two values with different enumeration types are compared in expressions with binary operators. This patch extends this diagnostic so that comparisons of mixed enumeration types are recognized in switch statements as well.
Example:
enum MixedA { A1, A2, A3 }; enum MixedB { B1, B2, B3 }; void MixedEnums(MixedA a) { switch (a) { case A1: break; // OK, same enum types. case B1: break; // Warn, different enum types. } }