clang-tools 23.0.0git
clang::tidy::hicpp Namespace Reference

Classes

class  MultiwayPathsCoveredCheck
 Find occasions where not all codepaths are explicitly covered in code. More...

Functions

static ClangTidyModuleRegistry::Add< HICPPModule > X ("hicpp-module", "Adds High-Integrity C++ checks.")
static std::pair< std::size_t, bool > countCaseLabels (const SwitchStmt *Switch)
static std::size_t twoPow (std::size_t Bits)
 This function calculate 2 ** Bits and returns numeric_limits<std::size_t>::max() if an overflow occurred.
static std::size_t getNumberOfPossibleValues (QualType T, const ASTContext &Context)
 Get the number of possible values that can be switched on for the type T.

Function Documentation

◆ countCaseLabels()

std::pair< std::size_t, bool > clang::tidy::hicpp::countCaseLabels ( const SwitchStmt * Switch)
static

◆ getNumberOfPossibleValues()

std::size_t clang::tidy::hicpp::getNumberOfPossibleValues ( QualType T,
const ASTContext & Context )
static

Get the number of possible values that can be switched on for the type T.

Returns
- 0 if bitcount could not be determined
  • numeric_limits<std::size_t>::max() when overflow appeared due to more than 64 bits type size.

Definition at line 79 of file MultiwayPathsCoveredCheck.cpp.

References twoPow().

◆ twoPow()

std::size_t clang::tidy::hicpp::twoPow ( std::size_t Bits)
static

This function calculate 2 ** Bits and returns numeric_limits<std::size_t>::max() if an overflow occurred.

Definition at line 68 of file MultiwayPathsCoveredCheck.cpp.

Referenced by getNumberOfPossibleValues().

◆ X()

ClangTidyModuleRegistry::Add< HICPPModule > clang::tidy::hicpp::X ( "hicpp-module" ,
"Adds High-Integrity C++ checks."  )
static