This documentation is archived and is not being maintained.

Compiler Warning (level 4) C4063

Error Message

case 'identifier' is not a valid value for switch of enum 'enumeration'

The expression in a switch statement is of an enum type, and one of the case values is not one of the enumerators in that enum.

The following sample generates C4063

// C4063.cpp
// compile with: /W4 /c
enum E { a, b };
void func ( E e ) {
   switch(e) {
      case a:
      case b:
      case 7:   // switch value not valid
   }   // C4063