18 const SwitchCase *Case = Node.getSwitchCaseList();
20 if (DefaultStmt::classof(Case))
23 Case = Case->getNextSwitchCase();
31 switchStmt(hasCondition(expr(unless(isInstantiationDependent()),
32 hasType(qualType(hasCanonicalType(
33 unless(hasDeclaration(enumDecl()))))))),
34 unless(hasDefaultCase()))
40 const ast_matchers::MatchFinder::MatchResult &Result) {
41 const auto *Switch = Result.Nodes.getNodeAs<SwitchStmt>(
"switch");
43 diag(Switch->getSwitchLoc(),
"switching on non-enum value without "
44 "default case may not cover all cases");
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
void registerMatchers(ast_matchers::MatchFinder *Finder) override
AST_MATCHER(BinaryOperator, isRelationalOperator)