clang-tools 19.0.0git
Classes | Functions
clang::tidy::hicpp Namespace Reference

Classes

class  ExceptionBaseclassCheck
 Check for thrown exceptions and enforce they are all derived from std::exception. More...
 
class  HICPPModule
 
class  IgnoredRemoveResultCheck
 Ensure that the result of std::remove, std::remove_if and std::unique are not ignored according to rule 17.5.1. More...
 
class  MultiwayPathsCoveredCheck
 Find occasions where not all codepaths are explicitly covered in code. More...
 
class  NoAssemblerCheck
 Find assembler statements. More...
 
class  SignedBitwiseCheck
 This check implements the rule 5.6.1 of the HICPP Standard, which disallows bitwise operations on signed integer types. More...
 

Functions

static ClangTidyModuleRegistry::Add< HICPPModuleX ("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()

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

◆ getNumberOfPossibleValues()

static 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()

static 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()

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