CodeQL library for C/C++
Search

Member predicate EnumSwitch::getAMissingCase

Gets a constant from the enum type that does not have a case in this ‘switch’ statement.

For example, with

enum color { RED, GREEN, BLUE };
enum color c;
switch (c) {
case RED:
    return 1;
default:
    return 2;
}

there are results GREEN and BLUE.

EnumConstant getAMissingCase()