CodeQL library for C/C++
codeql/cpp-all 0.12.9 (changelog, source)
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()