clang-tools 22.0.0git
clang::tidy::bugprone::SwitchMissingDefaultCaseCheck Class Reference

Ensures that switch statements without default cases are flagged, focuses only on covering cases with non-enums where the compiler may not issue warnings. More...

#include <SwitchMissingDefaultCaseCheck.h>

Inheritance diagram for clang::tidy::bugprone::SwitchMissingDefaultCaseCheck:
[legend]

Public Member Functions

 SwitchMissingDefaultCaseCheck (StringRef Name, ClangTidyContext *Context)
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override
std::optional< TraversalKind > getCheckTraversalKind () const override

Detailed Description

Ensures that switch statements without default cases are flagged, focuses only on covering cases with non-enums where the compiler may not issue warnings.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/switch-missing-default-case.html

Definition at line 24 of file SwitchMissingDefaultCaseCheck.h.

Constructor & Destructor Documentation

◆ SwitchMissingDefaultCaseCheck()

clang::tidy::bugprone::SwitchMissingDefaultCaseCheck::SwitchMissingDefaultCaseCheck ( StringRef Name,
ClangTidyContext * Context )
inline

Definition at line 26 of file SwitchMissingDefaultCaseCheck.h.

Member Function Documentation

◆ check()

void clang::tidy::bugprone::SwitchMissingDefaultCaseCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

Definition at line 39 of file SwitchMissingDefaultCaseCheck.cpp.

◆ getCheckTraversalKind()

std::optional< TraversalKind > clang::tidy::bugprone::SwitchMissingDefaultCaseCheck::getCheckTraversalKind ( ) const
inlineoverride

Definition at line 31 of file SwitchMissingDefaultCaseCheck.h.

◆ registerMatchers()

void clang::tidy::bugprone::SwitchMissingDefaultCaseCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Definition at line 29 of file SwitchMissingDefaultCaseCheck.cpp.


The documentation for this class was generated from the following files: