clang-tools 17.0.0git
|
Namespaces | |
namespace | filter |
namespace | model |
Classes | |
class | ArgumentCommentCheck |
Checks that argument comments match parameter names. More... | |
class | AssertSideEffectCheck |
Finds assert() with side effect. More... | |
class | AssignmentInIfConditionCheck |
Catches assignments within the condition clause of an if statement. More... | |
class | BadSignalToKillThreadCheck |
Finds pthread_kill function calls when thread is terminated by SIGTERM signal. More... | |
class | BoolPointerImplicitConversionCheck |
Checks for conditions based on implicit conversion from a bool pointer to bool. More... | |
class | BranchCloneCheck |
A check for detecting if/else if/else chains where two or more branches are Type I clones of each other (that is, they contain identical code), for detecting switch statements where two or more consecutive branches are Type I clones of each other, and for detecting conditional operators where the true and false expressions are Type I clones of each other. More... | |
class | BugproneModule |
class | CharExpressionDetector |
class | CopyConstructorInitCheck |
Finds copy constructors where the ctor don't call the copy constructor of the base class. More... | |
class | DanglingHandleCheck |
Detect dangling references in value handlers like std::experimental::string_view. More... | |
class | DynamicStaticInitializersCheck |
Finds dynamically initialized static variables in header files. More... | |
class | EasilySwappableParametersCheck |
Finds function definitions where parameters of convertible types follow each other directly, making call sites prone to calling the function with swapped (or badly ordered) arguments. More... | |
class | ExceptionEscapeCheck |
Finds functions which should not throw exceptions: Destructors, move constructors, move assignment operators, the main() function, swap() functions, functions marked with throw() or noexcept and functions given as option to the checker. More... | |
class | FoldInitTypeCheck |
Find and flag invalid initializer values in folds, e.g. More... | |
class | ForwardDeclarationNamespaceCheck |
Checks if an unused forward declaration is in a wrong namespace. More... | |
class | ForwardingReferenceOverloadCheck |
The checker looks for constructors that can act as copy or move constructors through their forwarding reference parameters. More... | |
class | ImplicitWideningOfMultiplicationResultCheck |
Diagnoses instances of an implicit widening of multiplication result. More... | |
class | InaccurateEraseCheck |
Checks for inaccurate use of the erase() method. More... | |
class | IncorrectRoundingsCheck |
Checks the usage of patterns known to produce incorrect rounding. More... | |
class | InfiniteLoopCheck |
Finds obvious infinite loops (loops where the condition variable is not changed at all). More... | |
class | IntegerDivisionCheck |
Finds cases where integer division in a floating point context is likely to cause unintended loss of precision. More... | |
class | LambdaFunctionNameCheck |
Detect when func or FUNCTION is being used from within a lambda. More... | |
class | MacroParenthesesCheck |
Finds macros that can have unexpected behaviour due to missing parentheses. More... | |
class | MacroRepeatedSideEffectsCheck |
Checks for repeated argument with side effects in macros. More... | |
class | MisplacedOperatorInStrlenInAllocCheck |
Finds cases where 1 is added to the string in the argument to a function in the strlen() family instead of the result and value is used as an argument to a memory allocation function. More... | |
class | MisplacedPointerArithmeticInAllocCheck |
Finds cases where an integer is added to or subracted from the result of a memory allocation function instead of its argument. More... | |
class | MisplacedWideningCastCheck |
Find casts of calculation results to bigger type. More... | |
class | MoveForwardingReferenceCheck |
The check warns if std::move is applied to a forwarding reference (i.e. More... | |
class | MultipleNewInOneExpressionCheck |
For the user-facing documentation see: http://clang.llvm.org/extra/clang-tidy/checks/bugprone/multiple-new-in-one-expression.html. More... | |
class | MultipleStatementMacroCheck |
Detect multiple statement macros that are used in unbraced conditionals. More... | |
class | NoEscapeCheck |
Block arguments in dispatch_async() and dispatch_after() are guaranteed to escape. More... | |
class | NonZeroEnumToBoolConversionCheck |
Detect implicit and explicit casts of enum type into bool where enum type doesn't have a zero-value enumerator. More... | |
class | NotNullTerminatedResultCheck |
Finds function calls where it is possible to cause a not null-terminated result. More... | |
class | ParentVirtualCallCheck |
Finds calls to grand..-parent virtual methods instead of parent's. More... | |
class | PosixReturnCheck |
class | RedundantBranchConditionCheck |
Finds condition variables in nested if statements that were also checked in the outer if statement and were not changed. More... | |
class | ReservedIdentifierCheck |
Checks for usages of identifiers reserved for use by the implementation. More... | |
class | SharedPtrArrayMismatchCheck |
Find std::shared_ptr<T>(new T[...]) , replace it (if applicable) with std::shared_ptr<T[]>(new T[...]) . More... | |
class | SignalHandlerCheck |
Checker for signal handler functions. More... | |
class | SignedCharMisuseCheck |
Finds those signed char -> integer conversions which might indicate a programming error. More... | |
class | SizeofContainerCheck |
Find usages of sizeof on expressions of STL container types. More... | |
class | SizeofExpressionCheck |
Find suspicious usages of sizeof expression. More... | |
class | SmartPtrArrayMismatchCheck |
Find constructions of smart (unique or shared) pointers where the pointer is declared with non-array target type and an array (created with a new-expression) is passed to it. More... | |
class | SpuriouslyWakeUpFunctionsCheck |
Finds cnd_wait , cnd_timedwait , wait , wait_for , or wait_until function calls when the function is not invoked from a loop that checks whether a condition predicate holds or the function has a condition parameter. More... | |
class | StandaloneEmptyCheck |
Checks for ignored calls to empty() on a range and suggests clear() as an alternative if it is an existing member function. More... | |
class | StringConstructorCheck |
Finds suspicious string constructor and check their parameters. More... | |
class | StringIntegerAssignmentCheck |
Finds instances where an integer is assigned to a string. More... | |
class | StringLiteralWithEmbeddedNulCheck |
Find suspicious string literals with embedded NUL characters. More... | |
class | StringviewNullptrCheck |
Checks for various ways that the const CharT* constructor of std::basic_string_view can be passed a null argument and replaces them with the default constructor in most cases. More... | |
class | SuspiciousEnumUsageCheck |
The checker detects various cases when an enum is probably misused (as a bitmask). More... | |
class | SuspiciousIncludeCheck |
Warns on inclusion of files whose names suggest that they're implementation files, instead of headers. More... | |
class | SuspiciousMemoryComparisonCheck |
Finds potentially incorrect calls to memcmp() based on properties of the arguments. More... | |
class | SuspiciousMemsetUsageCheck |
Finds memset calls with potential mistakes in their arguments. More... | |
class | SuspiciousMissingCommaCheck |
This check finds string literals which are probably concatenated accidentally. More... | |
class | SuspiciousReallocUsageCheck |
Finds usages of realloc where the return value is assigned to the same variable as passed to the first argument. More... | |
class | SuspiciousSemicolonCheck |
This check finds semicolon that modifies the meaning of the program unintendedly. More... | |
class | SuspiciousStringCompareCheck |
Find suspicious calls to string compare functions. More... | |
class | SwappedArgumentsCheck |
Finds potentially swapped arguments by looking at implicit conversions. More... | |
class | TerminatingContinueCheck |
Checks if a 'continue' statement terminates the loop (i.e. More... | |
class | ThrowKeywordMissingCheck |
Emits a warning about temporary objects whose type is (or is derived from) a class that has 'EXCEPTION', 'Exception' or 'exception' in its name. More... | |
class | TooSmallLoopVariableCheck |
This check gives a warning if a loop variable has a too small type which might not be able to represent all values which are part of the whole range in which the loop iterates. More... | |
class | UncheckedOptionalAccessCheck |
Warns when the code is unwrapping a std::optional<T> , absl::optional<T> , or base::std::optional<T> object without assuring that it contains a value. More... | |
class | UndefinedMemoryManipulationCheck |
Finds calls of memory manipulation functions memset() , memcpy() and memmove() on not TriviallyCopyable objects resulting in undefined behavior. More... | |
class | UndelegatedConstructorCheck |
Finds creation of temporary objects in constructors that look like a function call to another constructor of the same class. More... | |
class | UnhandledExceptionAtNewCheck |
Finds calls to 'new' that may throw unhandled exception at allocation failure. More... | |
class | UnhandledSelfAssignmentCheck |
Finds user-defined copy assignment operators which do not protect the code against self-assignment either by checking self-assignment explicitly or using the copy-and-swap or the copy-and-move method. More... | |
class | UniquePtrArrayMismatchCheck |
Finds initializations of C++ unique pointers to non-array type that are initialized with an array. More... | |
class | UnsafeFunctionsCheck |
Checks for functions that have safer, more secure replacements available, or are considered deprecated due to design flaws. More... | |
class | UnusedRaiiCheck |
Finds temporaries that look like RAII objects. More... | |
class | UnusedReturnValueCheck |
Detects function calls where the return value is unused. More... | |
class | UseAfterMoveCheck |
The check warns if an object is used after it has been moved, without an intervening reinitialization. More... | |
struct | ValueRange |
Stores a min and a max value which describe an interval. More... | |
class | VirtualNearMissCheck |
Checks for near miss of virtual methods. More... | |
Typedefs | |
using | TheCheck = EasilySwappableParametersCheck |
using | BasesVector = llvm::SmallVector< const CXXRecordDecl *, 5 > |
Enumerations | |
enum class | LengthHandleKind { Increase , Decrease } |
Functions | |
static std::vector< std::pair< SourceLocation, StringRef > > | getCommentsInRange (ASTContext *Ctx, CharSourceRange Range) |
static std::vector< std::pair< SourceLocation, StringRef > > | getCommentsBeforeLoc (ASTContext *Ctx, SourceLocation Loc) |
static bool | isLikelyTypo (llvm::ArrayRef< ParmVarDecl * > Params, StringRef ArgName, unsigned ArgIndex) |
static bool | sameName (StringRef InComment, StringRef InDecl, bool StrictMode) |
static bool | looksLikeExpectMethod (const CXXMethodDecl *Expect) |
static bool | areMockAndExpectMethods (const CXXMethodDecl *Mock, const CXXMethodDecl *Expect) |
static const CXXMethodDecl * | findMockedMethod (const CXXMethodDecl *Method) |
static const FunctionDecl * | resolveMocks (const FunctionDecl *Func) |
static void | checkImpl (const MatchFinder::MatchResult &Result, const Expr *Ref, const IfStmt *If, const ast_matchers::internal::Matcher< Expr > &RefMatcher, ClangTidyCheck &Check) |
AST_MATCHER (clang::VarDecl, hasConstantDeclaration) | |
AST_MATCHER_FUNCTION (ast_matchers::internal::Matcher< Stmt >, paramRefExpr) | |
Matches DeclRefExprs and their ignorable wrappers to ParmVarDecls. | |
AST_MATCHER_P (FunctionDecl, parameterCountGE, unsigned, N) | |
Matches functions that have at least the specified amount of parameters. | |
AST_MATCHER (FunctionDecl, isOverloadedUnaryOrBinaryOperator) | |
Matches any overloaded unary and binary operators. | |
static unsigned | clampMinimumLength (const unsigned Value) |
Returns the DefaultMinimumLength if the Value of requested minimum length is less than 2. | |
static SmallString< 64 > | getName (const NamedDecl *ND) |
Returns the diagnostic-friendly name of the node, or empty string. | |
static SmallString< 64 > | getNameOrUnnamed (const NamedDecl *ND) |
Returns the diagnostic-friendly name of the node, or a constant value. | |
static bool | needsToPrintTypeInDiagnostic (const model::Mix &M) |
Returns whether a particular Mix between two parameters should have the types involved diagnosed to the user. | |
static bool | needsToElaborateImplicitConversion (const model::Mix &M) |
Returns whether a particular Mix between the two parameters should have implicit conversions elaborated. | |
static bool | isValidBuiltinFold (const BuiltinType &ValueType, const BuiltinType &InitType, const ASTContext &Context) |
Returns true if ValueType is allowed to fold into InitType, i.e. | |
static bool | haveSameNamespaceOrTranslationUnit (const CXXRecordDecl *Decl1, const CXXRecordDecl *Decl2) |
static std::string | getNameOfNamespace (const CXXRecordDecl *Decl) |
static const Expr * | getLHSOfMulBinOp (const Expr *E) |
static llvm::APFloat | getHalf (const llvm::fltSemantics &Semantics) |
static internal::Matcher< Stmt > | loopEndingStmt (internal::Matcher< Stmt > Internal) |
static bool | isChanged (const Stmt *LoopStmt, const VarDecl *Var, ASTContext *Context) |
Return whether Var was changed in LoopStmt . | |
static bool | isVarThatIsPossiblyChanged (const Decl *Func, const Stmt *LoopStmt, const Stmt *Cond, ASTContext *Context) |
Return whether Cond is a variable that is possibly changed in LoopStmt . | |
static bool | isAtLeastOneCondVarChanged (const Decl *Func, const Stmt *LoopStmt, const Stmt *Cond, ASTContext *Context) |
Return whether at least one variable of Cond changed in LoopStmt . | |
static std::string | getCondVarNames (const Stmt *Cond) |
Return the variable names in Cond . | |
static bool | isKnownToHaveValue (const Expr &Cond, const ASTContext &Ctx, bool ExpectedValue) |
static bool | populateCallees (const Stmt *StmtNode, llvm::SmallSet< const Decl *, 16 > &Callees) |
populates the set Callees with all function (and objc method) declarations called in StmtNode if all visited call sites have resolved call targets. | |
static bool | overlap (ArrayRef< CallGraphNode * > SCC, const llvm::SmallSet< const Decl *, 16 > &Callees, const Decl *Func) |
returns true iff SCC contains Func and its' function set overlaps with Callees | |
static bool | hasStaticLocalVariable (const Stmt *Cond) |
returns true iff Cond involves at least one static local variable. | |
static bool | hasRecursionOverStaticLoopCondVariables (const Expr *Cond, const Stmt *LoopStmt, const Decl *Func, const ASTContext *Ctx) |
Tests if the loop condition Cond involves static local variables and the enclosing function Func is recursive. | |
static bool | isSurroundedLeft (const Token &T) |
Is argument surrounded properly with parentheses/braces/squares/commas? | |
static bool | isSurroundedRight (const Token &T) |
Is argument surrounded properly with parentheses/braces/squares/commas? | |
static bool | isKeyword (const Token &T) |
Is given TokenKind a keyword? | |
static bool | isWarnOp (const Token &T) |
Warning is written when one of these operators are not within parentheses. | |
static bool | isVarDeclKeyword (const Token &T) |
Is given Token a keyword that is used in variable declarations? | |
static bool | possibleVarDecl (const MacroInfo *MI, const Token *Tok) |
Is there a possible variable declaration at Tok? | |
static unsigned | getMaxCalculationWidth (const ASTContext &Context, const Expr *E) |
static int | relativeIntSizes (BuiltinType::Kind Kind) |
static int | relativeCharSizes (BuiltinType::Kind Kind) |
static int | relativeCharSizesW (BuiltinType::Kind Kind) |
static bool | isFirstWider (BuiltinType::Kind First, BuiltinType::Kind Second) |
static void | replaceMoveWithForward (const UnresolvedLookupExpr *Callee, const ParmVarDecl *ParmVar, const TemplateTypeParmDecl *TypeParmDecl, DiagnosticBuilder &Diag, const ASTContext &Context) |
AST_MATCHER_P (CXXTryStmt, hasHandlerFor, ast_matchers::internal::Matcher< QualType >, InnerMatcher) | |
AST_MATCHER (CXXNewExpr, mayThrow) | |
static const Expr * | getDestCapacityExpr (const MatchFinder::MatchResult &Result) |
static unsigned | getLength (const Expr *E, const MatchFinder::MatchResult &Result) |
static int | getDestCapacity (const MatchFinder::MatchResult &Result) |
static const CallExpr * | getStrlenExpr (const MatchFinder::MatchResult &Result) |
static int | getGivenLength (const MatchFinder::MatchResult &Result) |
static StringRef | exprToStr (const Expr *E, const MatchFinder::MatchResult &Result) |
static SourceLocation | exprLocEnd (const Expr *E, const MatchFinder::MatchResult &Result) |
static bool | isInjectUL (const MatchFinder::MatchResult &Result) |
static bool | isKnownDest (const MatchFinder::MatchResult &Result) |
static bool | isDestBasedOnGivenLength (const MatchFinder::MatchResult &Result) |
static bool | isDestAndSrcEquals (const MatchFinder::MatchResult &Result) |
static bool | isStringDataAndLength (const MatchFinder::MatchResult &Result) |
static bool | isGivenLengthEqualToSrcLength (const MatchFinder::MatchResult &Result) |
static bool | isCorrectGivenLength (const MatchFinder::MatchResult &Result) |
static bool | isDestCapacityOverflows (const MatchFinder::MatchResult &Result) |
static bool | isFixedGivenLengthAndUnknownSrc (const MatchFinder::MatchResult &Result) |
static void | lengthExprHandle (const Expr *LengthExpr, LengthHandleKind LengthHandle, const MatchFinder::MatchResult &Result, DiagnosticBuilder &Diag) |
static void | lengthArgHandle (LengthHandleKind LengthHandle, const MatchFinder::MatchResult &Result, DiagnosticBuilder &Diag) |
static void | lengthArgPosHandle (unsigned ArgPos, LengthHandleKind LengthHandle, const MatchFinder::MatchResult &Result, DiagnosticBuilder &Diag) |
static bool | isDestExprFix (const MatchFinder::MatchResult &Result, DiagnosticBuilder &Diag) |
static bool | isDestCapacityFix (const MatchFinder::MatchResult &Result, DiagnosticBuilder &Diag) |
static void | removeArg (int ArgPos, const MatchFinder::MatchResult &Result, DiagnosticBuilder &Diag) |
static void | renameFunc (StringRef NewFuncName, const MatchFinder::MatchResult &Result, DiagnosticBuilder &Diag) |
static void | renameMemcpy (StringRef Name, bool IsCopy, bool IsSafe, const MatchFinder::MatchResult &Result, DiagnosticBuilder &Diag) |
static void | insertDestCapacityArg (bool IsOverflows, StringRef Name, const MatchFinder::MatchResult &Result, DiagnosticBuilder &Diag) |
static void | insertNullTerminatorExpr (StringRef Name, const MatchFinder::MatchResult &Result, DiagnosticBuilder &Diag) |
static bool | isParentOf (const CXXRecordDecl &Parent, const CXXRecordDecl &ThisClass) |
static BasesVector | getParentsByGrandParent (const CXXRecordDecl &GrandParent, const CXXRecordDecl &ThisClass, const CXXMethodDecl &MemberDecl) |
static std::string | getNameAsString (const NamedDecl *Decl) |
static std::string | getExprAsString (const clang::Expr &E, clang::ASTContext &AC) |
static StringRef | getFunctionSpelling (const MatchFinder::MatchResult &Result, const char *BindingStr) |
static bool | isChangedBefore (const Stmt *S, const Stmt *NextS, const Stmt *PrevS, const VarDecl *Var, ASTContext *Context) |
Returns whether Var is changed in range (PrevS ..NextS ). | |
static int | getMessageSelectIndex (StringRef Tag) |
static std::string | collapseConsecutive (StringRef Str, char C) |
static bool | hasReservedDoubleUnderscore (StringRef Name, const LangOptions &LangOpts) |
static std::optional< std::string > | getDoubleUnderscoreFixup (StringRef Name, const LangOptions &LangOpts) |
static bool | startsWithUnderscoreCapital (StringRef Name) |
static std::optional< std::string > | getUnderscoreCapitalFixup (StringRef Name) |
static bool | startsWithUnderscoreInGlobalNamespace (StringRef Name, bool IsInGlobalNamespace) |
static std::optional< std::string > | getUnderscoreGlobalNamespaceFixup (StringRef Name, bool IsInGlobalNamespace) |
static std::string | getNonReservedFixup (std::string Name) |
static std::optional< RenamerClangTidyCheck::FailureInfo > | getFailureInfoImpl (StringRef Name, bool IsInGlobalNamespace, const LangOptions &LangOpts, bool Invert, ArrayRef< StringRef > AllowedIdentifiers) |
AST_MATCHER (FunctionDecl, isStandardFunction) | |
const Expr * | getCondition (const BoundNodes &Nodes, const StringRef NodeId) |
RewriteRuleWith< std::string > | StringviewNullptrCheckImpl () |
static int | enumLength (const EnumDecl *EnumDec) |
Return the number of EnumConstantDecls in an EnumDecl. | |
static bool | hasDisjointValueRange (const EnumDecl *Enum1, const EnumDecl *Enum2) |
static bool | isNonPowerOf2NorNullLiteral (const EnumConstantDecl *EnumConst) |
static bool | isMaxValAllBitSetLiteral (const EnumDecl *EnumDec) |
static int | countNonPowOfTwoLiteralNum (const EnumDecl *EnumDec) |
static bool | isPossiblyBitMask (const EnumDecl *EnumDec) |
Check if there is one or two enumerators that are not a power of 2 and are initialized by a literal in the enum type, and that the enumeration contains enough elements to reasonably act as a bitmask. | |
static std::optional< uint64_t > | tryEvaluateSizeExpr (const Expr *SizeExpr, const ASTContext &Ctx) |
static const Expr * | ignoreNoOpCasts (const Expr *E) |
Look through lvalue to rvalue and nop casts. | |
static bool | isImplicitCastCandidate (const CastExpr *Cast) |
Restrict the warning to implicit casts that are most likely accidental. | |
static MagnitudeBits | calcMagnitudeBits (const ASTContext &Context, const QualType &IntExprType, const Expr *IntExpr) |
Returns the magnitude bits of an integer type. | |
static MagnitudeBits | calcUpperBoundMagnitudeBits (const ASTContext &Context, const Expr *UpperBound, const QualType &UpperBoundType) |
Calculate the upper bound expression's magnitude bits, but ignore constant like values to reduce false positives. | |
static std::string | formatIntegralType (const QualType &Type, const MagnitudeBits &Info) |
static constexpr llvm::StringLiteral | FuncID ("fun") |
static std::optional< std::vector< SourceLocation > > | analyzeFunction (const FunctionDecl &FuncDecl, ASTContext &ASTCtx, UncheckedOptionalAccessModelOptions ModelOptions) |
static std::optional< std::string > | getAnnexKReplacementFor (StringRef FunctionName) |
static StringRef | getReplacementFor (StringRef FunctionName, bool IsAnnexKAvailable) |
static StringRef | getReplacementForAdditional (StringRef FunctionName, bool IsAnnexKAvailable) |
static StringRef | getRationaleFor (StringRef FunctionName) |
static bool | isAnnexKAvailable (std::optional< bool > &CacheVar, Preprocessor *PP, const LangOptions &LO) |
Calculates whether Annex K is available for the current translation unit based on the macro definitions and the language options. | |
template<typename T > | |
void | reportDiagnostic (DiagnosticBuilder D, const T *Node, SourceRange SR, bool DefaultConstruction) |
static StatementMatcher | inDecltypeOrTemplateArg () |
bool | isStandardSmartPointer (const ValueDecl *VD) |
static void | emitDiagnostic (const Expr *MovingCall, const DeclRefExpr *MoveArg, const UseAfterMove &Use, ClangTidyCheck *Check, ASTContext *Context) |
static bool | isOverrideMethod (const CXXMethodDecl *MD) |
Finds out if the given method overrides some method. | |
static bool | checkOverridingFunctionReturnType (const ASTContext *Context, const CXXMethodDecl *BaseMD, const CXXMethodDecl *DerivedMD) |
Checks whether the return types are covariant, according to C++[class.virtual]p7. | |
static QualType | getDecayedType (QualType Type) |
static bool | checkParamTypes (const CXXMethodDecl *BaseMD, const CXXMethodDecl *DerivedMD) |
static bool | checkOverrideWithoutName (const ASTContext *Context, const CXXMethodDecl *BaseMD, const CXXMethodDecl *DerivedMD) |
static bool | checkOverrideByDerivedMethod (const CXXMethodDecl *BaseMD, const CXXMethodDecl *DerivedMD) |
Check whether BaseMD overrides DerivedMD. | |
Variables | |
static Preprocessor * | PP |
constexpr llvm::StringLiteral | FunctionExprName = "FunctionExpr" |
constexpr llvm::StringLiteral | CastExprName = "CastExpr" |
constexpr llvm::StringLiteral | UnknownDestName = "UnknownDest" |
constexpr llvm::StringLiteral | DestArrayTyName = "DestArrayTy" |
constexpr llvm::StringLiteral | DestVarDeclName = "DestVarDecl" |
constexpr llvm::StringLiteral | DestMallocExprName = "DestMalloc" |
constexpr llvm::StringLiteral | DestExprName = "DestExpr" |
constexpr llvm::StringLiteral | SrcVarDeclName = "SrcVarDecl" |
constexpr llvm::StringLiteral | SrcExprName = "SrcExpr" |
constexpr llvm::StringLiteral | LengthExprName = "LengthExpr" |
constexpr llvm::StringLiteral | WrongLengthExprName = "WrongLength" |
constexpr llvm::StringLiteral | UnknownLengthName = "UnknownLength" |
static const char | CondVarStr [] = "cond_var" |
static const char | OuterIfStr [] = "outer_if" |
static const char | InnerIfStr [] = "inner_if" |
static const char | OuterIfVar1Str [] = "outer_if_var1" |
static const char | OuterIfVar2Str [] = "outer_if_var2" |
static const char | InnerIfVar1Str [] = "inner_if_var1" |
static const char | InnerIfVar2Str [] = "inner_if_var2" |
static const char | FuncStr [] = "func" |
static const char | DoubleUnderscoreTag [] = "du" |
static const char | UnderscoreCapitalTag [] = "uc" |
static const char | GlobalUnderscoreTag [] = "global-under" |
static const char | NonReservedTag [] = "non-reserved" |
static const char | Message [] |
static constexpr int | UnsignedASCIIUpperBound = 127 |
static const char | DifferentEnumErrorMessage [] |
static const char | BitmaskErrorMessage [] |
static const char | BitmaskVarErrorMessage [] |
static const char | BitmaskNoteMessage [] = "used here as a bitmask" |
static const char | KnownStringCompareFunctions [] |
static constexpr llvm::StringLiteral | LoopName |
static constexpr llvm::StringLiteral | LoopVarName |
static constexpr llvm::StringLiteral | LoopVarCastName |
static constexpr llvm::StringLiteral | LoopUpperBoundName |
static constexpr llvm::StringLiteral | LoopIncrementName |
static constexpr llvm::StringLiteral | OptionNameReportMoreUnsafeFunctions |
static constexpr llvm::StringLiteral | FunctionNamesWithAnnexKReplacementId |
static constexpr llvm::StringLiteral | FunctionNamesId = "FunctionsNames" |
static constexpr llvm::StringLiteral | AdditionalFunctionNamesId |
static constexpr llvm::StringLiteral | DeclRefId = "DRE" |
using clang::tidy::bugprone::BasesVector = typedef llvm::SmallVector<const CXXRecordDecl *, 5> |
Definition at line 22 of file ParentVirtualCallCheck.cpp.
using clang::tidy::bugprone::TheCheck = typedef EasilySwappableParametersCheck |
Definition at line 94 of file EasilySwappableParametersCheck.cpp.
|
strong |
Enumerator | |
---|---|
Increase | |
Decrease |
Definition at line 35 of file NotNullTerminatedResultCheck.cpp.
|
static |
Definition at line 36 of file UncheckedOptionalAccessCheck.cpp.
References Diagnostics, and Expected.
Referenced by clang::tidy::bugprone::UncheckedOptionalAccessCheck::check().
|
static |
Definition at line 190 of file ArgumentCommentCheck.cpp.
References looksLikeExpectMethod().
Referenced by findMockedMethod().
clang::tidy::bugprone::AST_MATCHER | ( | clang::VarDecl | , |
hasConstantDeclaration | |||
) |
Definition at line 18 of file DynamicStaticInitializersCheck.cpp.
clang::tidy::bugprone::AST_MATCHER | ( | CXXNewExpr | , |
mayThrow | |||
) |
Definition at line 73 of file MultipleNewInOneExpressionCheck.cpp.
clang::tidy::bugprone::AST_MATCHER | ( | FunctionDecl | , |
isOverloadedUnaryOrBinaryOperator | |||
) |
Matches any overloaded unary and binary operators.
Definition at line 1890 of file EasilySwappableParametersCheck.cpp.
clang::tidy::bugprone::AST_MATCHER | ( | FunctionDecl | , |
isStandardFunction | |||
) |
Definition at line 327 of file SignalHandlerCheck.cpp.
clang::tidy::bugprone::AST_MATCHER_FUNCTION | ( | ast_matchers::internal::Matcher< Stmt > | , |
paramRefExpr | |||
) |
Matches DeclRefExprs and their ignorable wrappers to ParmVarDecls.
Definition at line 1500 of file EasilySwappableParametersCheck.cpp.
clang::tidy::bugprone::AST_MATCHER_P | ( | CXXTryStmt | , |
hasHandlerFor | , | ||
ast_matchers::internal::Matcher< QualType > | , | ||
InnerMatcher | |||
) |
Definition at line 57 of file MultipleNewInOneExpressionCheck.cpp.
References Builder.
clang::tidy::bugprone::AST_MATCHER_P | ( | FunctionDecl | , |
parameterCountGE | , | ||
unsigned | , | ||
N | |||
) |
Matches functions that have at least the specified amount of parameters.
Definition at line 1885 of file EasilySwappableParametersCheck.cpp.
|
static |
Returns the magnitude bits of an integer type.
Definition at line 115 of file TooSmallLoopVariableCheck.cpp.
References BitFieldWidth.
Referenced by calcUpperBoundMagnitudeBits(), and clang::tidy::bugprone::TooSmallLoopVariableCheck::check().
|
static |
Calculate the upper bound expression's magnitude bits, but ignore constant like values to reduce false positives.
Definition at line 134 of file TooSmallLoopVariableCheck.cpp.
References calcMagnitudeBits().
Referenced by clang::tidy::bugprone::TooSmallLoopVariableCheck::check().
|
static |
Definition at line 34 of file BoolPointerImplicitConversionCheck.cpp.
Referenced by clang::tidy::bugprone::BoolPointerImplicitConversionCheck::check().
|
static |
Check whether BaseMD overrides DerivedMD.
Prerequisite: the class which BaseMD is in should be a base class of that DerivedMD is in.
Definition at line 167 of file VirtualNearMissCheck.cpp.
References E.
|
static |
Definition at line 147 of file VirtualNearMissCheck.cpp.
References checkOverridingFunctionReturnType(), and checkParamTypes().
Referenced by clang::tidy::bugprone::VirtualNearMissCheck::check().
|
static |
Checks whether the return types are covariant, according to C++[class.virtual]p7.
Similar with clang::Sema::CheckOverridingFunctionReturnType.
Check if the return types are covariant.
BTy is the class type in return type of BaseMD. For example, B* Base::md() While BRD is the declaration of B.
Definition at line 37 of file VirtualNearMissCheck.cpp.
References Path.
Referenced by checkOverrideWithoutName().
|
static |
Definition at line 129 of file VirtualNearMissCheck.cpp.
References getDecayedType().
Referenced by checkOverrideWithoutName().
|
inlinestatic |
Returns the DefaultMinimumLength if the Value of requested minimum length is less than 2.
Minimum lengths of 0 or 1 are not accepted.
Definition at line 1908 of file EasilySwappableParametersCheck.cpp.
References DefaultMinimumLength.
|
static |
Definition at line 56 of file ReservedIdentifierCheck.cpp.
References C.
Referenced by getDoubleUnderscoreFixup().
|
static |
Definition at line 87 of file SuspiciousEnumUsageCheck.cpp.
References isNonPowerOf2NorNullLiteral().
Referenced by isPossiblyBitMask().
|
static |
Definition at line 362 of file UseAfterMoveCheck.cpp.
References clang::tidy::ClangTidyCheck::diag(), and emitDiagnostic().
Referenced by clang::tidy::bugprone::UseAfterMoveCheck::check(), and emitDiagnostic().
|
static |
Return the number of EnumConstantDecls in an EnumDecl.
Definition at line 51 of file SuspiciousEnumUsageCheck.cpp.
Referenced by isPossiblyBitMask().
|
static |
Definition at line 150 of file NotNullTerminatedResultCheck.cpp.
References E.
Referenced by insertNullTerminatorExpr(), lengthExprHandle(), and removeArg().
|
static |
Definition at line 139 of file NotNullTerminatedResultCheck.cpp.
References E.
Referenced by insertDestCapacityArg(), insertNullTerminatorExpr(), isDestBasedOnGivenLength(), isDestCapacityOverflows(), and lengthExprHandle().
|
static |
Definition at line 205 of file ArgumentCommentCheck.cpp.
References areMockAndExpectMethods(), and looksLikeExpectMethod().
Referenced by resolveMocks().
|
static |
Definition at line 170 of file TooSmallLoopVariableCheck.cpp.
References Info, Name, and Type.
Referenced by clang::tidy::bugprone::TooSmallLoopVariableCheck::check().
|
staticconstexpr |
|
static |
Definition at line 34 of file UnsafeFunctionsCheck.cpp.
Referenced by clang::tidy::bugprone::UnsafeFunctionsCheck::check().
|
static |
Definition at line 125 of file ArgumentCommentCheck.cpp.
References clang::tidy::utils::lexer::getPreviousToken(), and Loc.
|
static |
Definition at line 81 of file ArgumentCommentCheck.cpp.
References Range.
const Expr * clang::tidy::bugprone::getCondition | ( | const BoundNodes & | Nodes, |
const StringRef | NodeId | ||
) |
Definition at line 50 of file StandaloneEmptyCheck.cpp.
Referenced by clang::tidy::bugprone::StandaloneEmptyCheck::check().
|
static |
Return the variable names in Cond
.
Definition at line 123 of file InfiniteLoopCheck.cpp.
References getCondVarNames().
Referenced by clang::tidy::bugprone::InfiniteLoopCheck::check(), and getCondVarNames().
|
static |
Definition at line 122 of file VirtualNearMissCheck.cpp.
References Type.
Referenced by checkParamTypes().
|
static |
Definition at line 95 of file NotNullTerminatedResultCheck.cpp.
References getDestCapacityExpr(), and getLength().
Referenced by insertDestCapacityArg().
|
static |
Definition at line 44 of file NotNullTerminatedResultCheck.cpp.
References DestArrayTyName, DestMallocExprName, and DestVarDeclName.
Referenced by getDestCapacity(), insertDestCapacityArg(), isDestBasedOnGivenLength(), isDestCapacityFix(), and isDestCapacityOverflows().
|
static |
Definition at line 71 of file ReservedIdentifierCheck.cpp.
References collapseConsecutive(), hasReservedDoubleUnderscore(), and Name.
Referenced by getFailureInfoImpl().
|
static |
Definition at line 70 of file ParentVirtualCallCheck.cpp.
Referenced by clang::tidy::bugprone::ParentVirtualCallCheck::check().
|
static |
Definition at line 109 of file ReservedIdentifierCheck.cpp.
References DoubleUnderscoreTag, getDoubleUnderscoreFixup(), getNonReservedFixup(), getUnderscoreCapitalFixup(), getUnderscoreGlobalNamespaceFixup(), GlobalUnderscoreTag, hasReservedDoubleUnderscore(), Info, Kind, Name, NonReservedTag, startsWithUnderscoreCapital(), startsWithUnderscoreInGlobalNamespace(), and UnderscoreCapitalTag.
|
static |
Definition at line 19 of file PosixReturnCheck.cpp.
Referenced by clang::tidy::bugprone::PosixReturnCheck::check().
|
static |
Definition at line 117 of file NotNullTerminatedResultCheck.cpp.
References getLength(), getStrlenExpr(), Length, LengthExprName, UnknownLengthName, and WrongLengthExprName.
Referenced by isDestCapacityOverflows(), isGivenLengthEqualToSrcLength(), and isInjectUL().
|
static |
Definition at line 20 of file IncorrectRoundingsCheck.cpp.
|
static |
Definition at line 62 of file NotNullTerminatedResultCheck.cpp.
Referenced by getDestCapacity(), getGivenLength(), isDestCapacityOverflows(), isFixedGivenLengthAndUnknownSrc(), and isGivenLengthEqualToSrcLength().
|
static |
Definition at line 26 of file ImplicitWideningOfMultiplicationResultCheck.cpp.
References E.
|
static |
Definition at line 51 of file MisplacedWideningCastCheck.cpp.
References E, and getMaxCalculationWidth().
Referenced by clang::tidy::bugprone::MisplacedWideningCastCheck::check(), and getMaxCalculationWidth().
|
static |
Definition at line 34 of file ReservedIdentifierCheck.cpp.
References GlobalUnderscoreTag, NonReservedTag, and Tag.
|
static |
Returns the diagnostic-friendly name of the node, or empty string.
Definition at line 1915 of file EasilySwappableParametersCheck.cpp.
Referenced by clang::tidy::bugprone::EasilySwappableParametersCheck::check(), and getNameOrUnnamed().
|
static |
Definition at line 59 of file ParentVirtualCallCheck.cpp.
Referenced by clang::tidy::bugprone::ParentVirtualCallCheck::check().
|
static |
Definition at line 101 of file ForwardDeclarationNamespaceCheck.cpp.
References Decl.
Referenced by clang::tidy::bugprone::ForwardDeclarationNamespaceCheck::onEndOfTranslationUnit().
|
static |
Returns the diagnostic-friendly name of the node, or a constant value.
Definition at line 1923 of file EasilySwappableParametersCheck.cpp.
References getName(), and Name.
Referenced by clang::tidy::bugprone::EasilySwappableParametersCheck::check().
|
static |
Definition at line 99 of file ReservedIdentifierCheck.cpp.
References Name.
Referenced by getFailureInfoImpl().
|
static |
Definition at line 36 of file ParentVirtualCallCheck.cpp.
References Type.
Referenced by clang::tidy::bugprone::ParentVirtualCallCheck::check().
|
static |
FunctionName
with the safer alternative. Definition at line 86 of file UnsafeFunctionsCheck.cpp.
Referenced by clang::tidy::bugprone::UnsafeFunctionsCheck::check().
|
static |
Definition at line 41 of file UnsafeFunctionsCheck.cpp.
Referenced by clang::tidy::bugprone::UnsafeFunctionsCheck::check().
|
static |
Definition at line 63 of file UnsafeFunctionsCheck.cpp.
Referenced by clang::tidy::bugprone::UnsafeFunctionsCheck::check().
|
static |
Definition at line 103 of file NotNullTerminatedResultCheck.cpp.
References Decl, and WrongLengthExprName.
Referenced by getGivenLength(), and isGivenLengthEqualToSrcLength().
|
static |
Definition at line 81 of file ReservedIdentifierCheck.cpp.
References Name, and startsWithUnderscoreCapital().
Referenced by getFailureInfoImpl().
|
static |
Definition at line 93 of file ReservedIdentifierCheck.cpp.
References Name, and startsWithUnderscoreInGlobalNamespace().
Referenced by getFailureInfoImpl().
|
static |
Definition at line 55 of file SuspiciousEnumUsageCheck.cpp.
References clang::tidy::bugprone::ValueRange::MaxVal, and clang::tidy::bugprone::ValueRange::MinVal.
Referenced by clang::tidy::bugprone::SuspiciousEnumUsageCheck::check().
|
static |
Tests if the loop condition Cond
involves static local variables and the enclosing function Func
is recursive.
The example above is NOT an infinite loop.
Definition at line 239 of file InfiniteLoopCheck.cpp.
References hasStaticLocalVariable(), overlap(), and populateCallees().
Referenced by clang::tidy::bugprone::InfiniteLoopCheck::check().
|
static |
Definition at line 63 of file ReservedIdentifierCheck.cpp.
References Name.
Referenced by getDoubleUnderscoreFixup(), and getFailureInfoImpl().
|
static |
returns true iff Cond
involves at least one static local variable.
Definition at line 217 of file InfiniteLoopCheck.cpp.
References hasStaticLocalVariable().
Referenced by hasRecursionOverStaticLoopCondVariables(), and hasStaticLocalVariable().
|
static |
Definition at line 80 of file ForwardDeclarationNamespaceCheck.cpp.
Referenced by clang::tidy::bugprone::ForwardDeclarationNamespaceCheck::onEndOfTranslationUnit().
|
static |
Look through lvalue to rvalue and nop casts.
This filters out implicit conversions that have no effect on the input but block our view for other implicit casts.
Definition at line 26 of file SwappedArgumentsCheck.cpp.
References E, and ignoreNoOpCasts().
Referenced by clang::tidy::bugprone::SwappedArgumentsCheck::check(), and ignoreNoOpCasts().
|
static |
Definition at line 81 of file UseAfterMoveCheck.cpp.
Referenced by clang::tidy::bugprone::UseAfterMoveCheck::registerMatchers().
|
static |
Definition at line 447 of file NotNullTerminatedResultCheck.cpp.
References exprToStr(), FunctionExprName, getDestCapacity(), getDestCapacityExpr(), and isInjectUL().
|
static |
Definition at line 468 of file NotNullTerminatedResultCheck.cpp.
References DestExprName, exprLocEnd(), exprToStr(), FunctionExprName, LengthExprName, and Name.
|
static |
Calculates whether Annex K is available for the current translation unit based on the macro definitions and the language options.
The result is cached and saved in CacheVar
.
Definition at line 104 of file UnsafeFunctionsCheck.cpp.
References PP.
Referenced by clang::tidy::bugprone::UnsafeFunctionsCheck::check().
|
static |
Return whether at least one variable of Cond
changed in LoopStmt
.
Definition at line 107 of file InfiniteLoopCheck.cpp.
References isAtLeastOneCondVarChanged(), and isVarThatIsPossiblyChanged().
Referenced by clang::tidy::bugprone::InfiniteLoopCheck::check(), and isAtLeastOneCondVarChanged().
|
static |
Return whether Var
was changed in LoopStmt
.
Definition at line 53 of file InfiniteLoopCheck.cpp.
Referenced by isVarThatIsPossiblyChanged().
|
static |
Returns whether Var
is changed in range (PrevS
..NextS
).
Definition at line 31 of file RedundantBranchConditionCheck.cpp.
Referenced by clang::tidy::bugprone::RedundantBranchConditionCheck::check().
|
static |
Definition at line 247 of file NotNullTerminatedResultCheck.cpp.
References isGivenLengthEqualToSrcLength(), and UnknownLengthName.
|
static |
Definition at line 185 of file NotNullTerminatedResultCheck.cpp.
References DestExprName, and SrcExprName.
|
static |
Definition at line 174 of file NotNullTerminatedResultCheck.cpp.
References exprToStr(), getDestCapacityExpr(), and LengthExprName.
|
static |
Definition at line 397 of file NotNullTerminatedResultCheck.cpp.
References getDestCapacityExpr(), Increase, isDestCapacityOverflows(), and lengthExprHandle().
|
static |
Definition at line 257 of file NotNullTerminatedResultCheck.cpp.
References exprToStr(), getDestCapacityExpr(), getGivenLength(), getLength(), isGivenLengthEqualToSrcLength(), and isKnownDest().
Referenced by isDestCapacityFix().
|
static |
Definition at line 380 of file NotNullTerminatedResultCheck.cpp.
References DestExprName.
|
static |
Definition at line 165 of file MisplacedWideningCastCheck.cpp.
References relativeCharSizes(), relativeCharSizesW(), and relativeIntSizes().
Referenced by clang::tidy::bugprone::MisplacedWideningCastCheck::check().
|
static |
Definition at line 278 of file NotNullTerminatedResultCheck.cpp.
References getLength(), SrcExprName, and WrongLengthExprName.
|
static |
Definition at line 220 of file NotNullTerminatedResultCheck.cpp.
References getGivenLength(), getLength(), getStrlenExpr(), isStringDataAndLength(), LengthExprName, SrcExprName, SrcVarDeclName, and UnknownLengthName.
Referenced by isCorrectGivenLength(), and isDestCapacityOverflows().
|
static |
Restrict the warning to implicit casts that are most likely accidental.
User defined or integral conversions fit in this category, lvalue to rvalue or derived to base does not.
Definition at line 37 of file SwappedArgumentsCheck.cpp.
Referenced by clang::tidy::bugprone::SwappedArgumentsCheck::check().
|
static |
Definition at line 163 of file NotNullTerminatedResultCheck.cpp.
References getGivenLength().
Referenced by insertDestCapacityArg(), and lengthExprHandle().
|
static |
Is given TokenKind a keyword?
Definition at line 53 of file MacroParenthesesCheck.cpp.
|
static |
Definition at line 168 of file NotNullTerminatedResultCheck.cpp.
References UnknownDestName.
Referenced by isDestCapacityOverflows().
|
static |
Definition at line 142 of file InfiniteLoopCheck.cpp.
References isKnownToHaveValue().
Referenced by clang::tidy::bugprone::InfiniteLoopCheck::check(), and isKnownToHaveValue().
|
static |
Definition at line 143 of file ArgumentCommentCheck.cpp.
References E.
|
static |
Definition at line 72 of file SuspiciousEnumUsageCheck.cpp.
Referenced by isPossiblyBitMask().
|
static |
Definition at line 62 of file SuspiciousEnumUsageCheck.cpp.
Referenced by countNonPowOfTwoLiteralNum().
|
static |
Finds out if the given method overrides some method.
Definition at line 28 of file VirtualNearMissCheck.cpp.
|
static |
Definition at line 24 of file ParentVirtualCallCheck.cpp.
References Parent.
Referenced by clang::tidy::bugprone::ParentVirtualCallCheck::check().
|
static |
Check if there is one or two enumerators that are not a power of 2 and are initialized by a literal in the enum type, and that the enumeration contains enough elements to reasonably act as a bitmask.
Exclude the case where the last enumerator is the sum of the lesser values (and initialized by a literal) or when it could contain consecutive values.
Definition at line 96 of file SuspiciousEnumUsageCheck.cpp.
References countNonPowOfTwoLiteralNum(), enumLength(), isMaxValAllBitSetLiteral(), clang::tidy::bugprone::ValueRange::MaxVal, and clang::tidy::bugprone::ValueRange::MinVal.
Referenced by clang::tidy::bugprone::SuspiciousEnumUsageCheck::check().
bool clang::tidy::bugprone::isStandardSmartPointer | ( | const ValueDecl * | VD | ) |
Definition at line 218 of file UseAfterMoveCheck.cpp.
References isStandardSmartPointer(), Name, and Type.
Referenced by isStandardSmartPointer().
|
static |
Definition at line 195 of file NotNullTerminatedResultCheck.cpp.
References DestExprName, SrcExprName, and WrongLengthExprName.
Referenced by isGivenLengthEqualToSrcLength().
|
static |
Is argument surrounded properly with parentheses/braces/squares/commas?
Definition at line 41 of file MacroParenthesesCheck.cpp.
|
static |
Is argument surrounded properly with parentheses/braces/squares/commas?
Definition at line 47 of file MacroParenthesesCheck.cpp.
|
static |
Returns true if ValueType is allowed to fold into InitType, i.e.
if: static_cast<InitType>(ValueType{some_value}) does not result in trucation.
Definition at line 92 of file FoldInitTypeCheck.cpp.
|
static |
Is given Token a keyword that is used in variable declarations?
Definition at line 67 of file MacroParenthesesCheck.cpp.
Referenced by possibleVarDecl().
|
static |
Return whether Cond
is a variable that is possibly changed in LoopStmt
.
Definition at line 69 of file InfiniteLoopCheck.cpp.
References CE, and isChanged().
Referenced by isAtLeastOneCondVarChanged().
|
static |
Warning is written when one of these operators are not within parentheses.
Definition at line 59 of file MacroParenthesesCheck.cpp.
|
static |
Definition at line 364 of file NotNullTerminatedResultCheck.cpp.
References lengthExprHandle(), and LengthExprName.
|
static |
Definition at line 371 of file NotNullTerminatedResultCheck.cpp.
References FunctionExprName, and lengthExprHandle().
|
static |
Definition at line 290 of file NotNullTerminatedResultCheck.cpp.
References Decrease, exprLocEnd(), exprToStr(), Increase, isInjectUL(), and PP.
Referenced by isDestCapacityFix(), lengthArgHandle(), and lengthArgPosHandle().
|
static |
Definition at line 185 of file ArgumentCommentCheck.cpp.
Referenced by areMockAndExpectMethods(), and findMockedMethod().
|
static |
Definition at line 37 of file InfiniteLoopCheck.cpp.
Referenced by clang::tidy::bugprone::InfiniteLoopCheck::registerMatchers().
|
inlinestatic |
Returns whether a particular Mix between the two parameters should have implicit conversions elaborated.
Definition at line 1941 of file EasilySwappableParametersCheck.cpp.
References clang::tidy::bugprone::model::ImplicitConversion, and M.
Referenced by clang::tidy::bugprone::EasilySwappableParametersCheck::check().
|
inlinestatic |
Returns whether a particular Mix between two parameters should have the types involved diagnosed to the user.
This is only a flag check.
Definition at line 1932 of file EasilySwappableParametersCheck.cpp.
References M.
Referenced by clang::tidy::bugprone::EasilySwappableParametersCheck::check().
|
static |
returns true iff SCC
contains Func
and its' function set overlaps with Callees
Definition at line 200 of file InfiniteLoopCheck.cpp.
References Decl.
Referenced by hasRecursionOverStaticLoopCondVariables().
|
static |
populates the set Callees
with all function (and objc method) declarations called in StmtNode
if all visited call sites have resolved call targets.
CallExprs
visited have callees; false otherwise indicating there is an unresolved indirect call. Definition at line 176 of file InfiniteLoopCheck.cpp.
References Decl, and populateCallees().
Referenced by hasRecursionOverStaticLoopCondVariables(), and populateCallees().
|
static |
Is there a possible variable declaration at Tok?
Definition at line 75 of file MacroParenthesesCheck.cpp.
References isVarDeclKeyword().
|
static |
Definition at line 127 of file MisplacedWideningCastCheck.cpp.
References Kind.
Referenced by isFirstWider().
|
static |
Definition at line 146 of file MisplacedWideningCastCheck.cpp.
References Kind.
Referenced by isFirstWider().
|
static |
Definition at line 92 of file MisplacedWideningCastCheck.cpp.
References Kind.
Referenced by isFirstWider().
|
static |
Definition at line 407 of file NotNullTerminatedResultCheck.cpp.
References exprLocEnd(), and FunctionExprName.
|
static |
Definition at line 422 of file NotNullTerminatedResultCheck.cpp.
References FunctionExprName.
Referenced by renameMemcpy().
|
static |
Definition at line 437 of file NotNullTerminatedResultCheck.cpp.
References Name, and renameFunc().
|
static |
Definition at line 19 of file MoveForwardingReferenceCheck.cpp.
Referenced by clang::tidy::bugprone::MoveForwardingReferenceCheck::check().
void clang::tidy::bugprone::reportDiagnostic | ( | DiagnosticBuilder | D, |
const T * | Node, | ||
SourceRange | SR, | ||
bool | DefaultConstruction | ||
) |
Definition at line 40 of file UnusedRaiiCheck.cpp.
Referenced by clang::tidy::bugprone::UnusedRaiiCheck::check().
|
static |
Definition at line 230 of file ArgumentCommentCheck.cpp.
References findMockedMethod().
|
static |
Definition at line 176 of file ArgumentCommentCheck.cpp.
|
static |
Definition at line 77 of file ReservedIdentifierCheck.cpp.
References Name.
Referenced by getFailureInfoImpl(), and getUnderscoreCapitalFixup().
|
static |
Definition at line 87 of file ReservedIdentifierCheck.cpp.
References Name.
Referenced by getFailureInfoImpl(), and getUnderscoreGlobalNamespaceFixup().
RewriteRuleWith< std::string > clang::tidy::bugprone::StringviewNullptrCheckImpl | ( | ) |
Definition at line 38 of file StringviewNullptrCheck.cpp.
|
static |
Definition at line 18 of file SuspiciousMemoryComparisonCheck.cpp.
Referenced by clang::tidy::bugprone::SuspiciousMemoryComparisonCheck::check().
|
staticconstexpr |
Definition at line 29 of file UnsafeFunctionsCheck.cpp.
Referenced by clang::tidy::bugprone::UnsafeFunctionsCheck::check(), and clang::tidy::bugprone::UnsafeFunctionsCheck::registerMatchers().
|
static |
Definition at line 21 of file SuspiciousEnumUsageCheck.cpp.
|
static |
Definition at line 31 of file SuspiciousEnumUsageCheck.cpp.
|
static |
Definition at line 26 of file SuspiciousEnumUsageCheck.cpp.
|
constexpr |
Definition at line 23 of file NotNullTerminatedResultCheck.cpp.
Referenced by clang::tidy::bugprone::NotNullTerminatedResultCheck::registerMatchers().
|
static |
Definition at line 21 of file RedundantBranchConditionCheck.cpp.
Referenced by clang::tidy::bugprone::RedundantBranchConditionCheck::check(), and clang::tidy::bugprone::RedundantBranchConditionCheck::registerMatchers().
|
staticconstexpr |
Definition at line 31 of file UnsafeFunctionsCheck.cpp.
Referenced by clang::tidy::bugprone::UnsafeFunctionsCheck::check(), and clang::tidy::bugprone::UnsafeFunctionsCheck::registerMatchers().
|
constexpr |
Definition at line 25 of file NotNullTerminatedResultCheck.cpp.
Referenced by getDestCapacityExpr(), and clang::tidy::bugprone::NotNullTerminatedResultCheck::registerMatchers().
|
constexpr |
Definition at line 28 of file NotNullTerminatedResultCheck.cpp.
Referenced by insertNullTerminatorExpr(), isDestAndSrcEquals(), isDestExprFix(), isStringDataAndLength(), and clang::tidy::bugprone::NotNullTerminatedResultCheck::registerMatchers().
|
constexpr |
Definition at line 27 of file NotNullTerminatedResultCheck.cpp.
Referenced by getDestCapacityExpr(), and clang::tidy::bugprone::NotNullTerminatedResultCheck::registerMatchers().
|
constexpr |
Definition at line 26 of file NotNullTerminatedResultCheck.cpp.
Referenced by getDestCapacityExpr(), and clang::tidy::bugprone::NotNullTerminatedResultCheck::registerMatchers().
|
static |
Definition at line 18 of file SuspiciousEnumUsageCheck.cpp.
Referenced by clang::tidy::bugprone::SuspiciousEnumUsageCheck::check().
|
static |
Definition at line 25 of file ReservedIdentifierCheck.cpp.
Referenced by getFailureInfoImpl().
|
static |
Definition at line 28 of file RedundantBranchConditionCheck.cpp.
Referenced by clang::tidy::bugprone::RedundantBranchConditionCheck::check(), and clang::tidy::bugprone::RedundantBranchConditionCheck::registerMatchers().
|
constexpr |
Definition at line 22 of file NotNullTerminatedResultCheck.cpp.
Referenced by clang::tidy::bugprone::NotNullTerminatedResultCheck::check(), insertDestCapacityArg(), insertNullTerminatorExpr(), lengthArgPosHandle(), clang::tidy::bugprone::NotNullTerminatedResultCheck::registerMatchers(), removeArg(), and renameFunc().
|
staticconstexpr |
Definition at line 28 of file UnsafeFunctionsCheck.cpp.
Referenced by clang::tidy::bugprone::UnsafeFunctionsCheck::check(), and clang::tidy::bugprone::UnsafeFunctionsCheck::registerMatchers().
|
staticconstexpr |
Definition at line 26 of file UnsafeFunctionsCheck.cpp.
Referenced by clang::tidy::bugprone::UnsafeFunctionsCheck::check(), and clang::tidy::bugprone::UnsafeFunctionsCheck::registerMatchers().
|
static |
Definition at line 27 of file ReservedIdentifierCheck.cpp.
Referenced by getFailureInfoImpl(), and getMessageSelectIndex().
|
static |
Definition at line 23 of file RedundantBranchConditionCheck.cpp.
Referenced by clang::tidy::bugprone::RedundantBranchConditionCheck::check(), and clang::tidy::bugprone::RedundantBranchConditionCheck::registerMatchers().
|
static |
Definition at line 26 of file RedundantBranchConditionCheck.cpp.
Referenced by clang::tidy::bugprone::RedundantBranchConditionCheck::check(), and clang::tidy::bugprone::RedundantBranchConditionCheck::registerMatchers().
|
static |
Definition at line 27 of file RedundantBranchConditionCheck.cpp.
Referenced by clang::tidy::bugprone::RedundantBranchConditionCheck::check(), and clang::tidy::bugprone::RedundantBranchConditionCheck::registerMatchers().
|
static |
Definition at line 22 of file SuspiciousStringCompareCheck.cpp.
Referenced by clang::tidy::bugprone::SuspiciousStringCompareCheck::registerMatchers().
|
constexpr |
Definition at line 31 of file NotNullTerminatedResultCheck.cpp.
Referenced by getGivenLength(), insertNullTerminatorExpr(), isDestBasedOnGivenLength(), isGivenLengthEqualToSrcLength(), lengthArgHandle(), and clang::tidy::bugprone::NotNullTerminatedResultCheck::registerMatchers().
|
staticconstexpr |
Definition at line 25 of file TooSmallLoopVariableCheck.cpp.
Referenced by clang::tidy::bugprone::TooSmallLoopVariableCheck::check(), and clang::tidy::bugprone::TooSmallLoopVariableCheck::registerMatchers().
|
staticconstexpr |
Definition at line 17 of file TooSmallLoopVariableCheck.cpp.
Referenced by clang::tidy::bugprone::TooSmallLoopVariableCheck::registerMatchers().
|
staticconstexpr |
Definition at line 23 of file TooSmallLoopVariableCheck.cpp.
Referenced by clang::tidy::bugprone::TooSmallLoopVariableCheck::check(), and clang::tidy::bugprone::TooSmallLoopVariableCheck::registerMatchers().
|
staticconstexpr |
Definition at line 21 of file TooSmallLoopVariableCheck.cpp.
Referenced by clang::tidy::bugprone::TooSmallLoopVariableCheck::registerMatchers().
|
staticconstexpr |
Definition at line 19 of file TooSmallLoopVariableCheck.cpp.
Referenced by clang::tidy::bugprone::TooSmallLoopVariableCheck::check(), and clang::tidy::bugprone::TooSmallLoopVariableCheck::registerMatchers().
|
static |
Definition at line 30 of file ReservedIdentifierCheck.cpp.
|
static |
Definition at line 28 of file ReservedIdentifierCheck.cpp.
Referenced by getFailureInfoImpl(), and getMessageSelectIndex().
|
staticconstexpr |
Definition at line 23 of file UnsafeFunctionsCheck.cpp.
Referenced by clang::tidy::bugprone::UnsafeFunctionsCheck::storeOptions().
|
static |
Definition at line 22 of file RedundantBranchConditionCheck.cpp.
Referenced by clang::tidy::bugprone::RedundantBranchConditionCheck::check(), and clang::tidy::bugprone::RedundantBranchConditionCheck::registerMatchers().
|
static |
Definition at line 24 of file RedundantBranchConditionCheck.cpp.
Referenced by clang::tidy::bugprone::RedundantBranchConditionCheck::check(), and clang::tidy::bugprone::RedundantBranchConditionCheck::registerMatchers().
|
static |
Definition at line 25 of file RedundantBranchConditionCheck.cpp.
Referenced by clang::tidy::bugprone::RedundantBranchConditionCheck::check(), and clang::tidy::bugprone::RedundantBranchConditionCheck::registerMatchers().
|
static |
Definition at line 28 of file BadSignalToKillThreadCheck.cpp.
Referenced by clang::tidy::bugprone::BadSignalToKillThreadCheck::check(), clang::tidy::bugprone::EasilySwappableParametersCheck::check(), clang::tidy::bugprone::NotNullTerminatedResultCheck::check(), getNameAsString(), isAnnexKAvailable(), lengthExprHandle(), clang::tidy::bugprone::BadSignalToKillThreadCheck::registerPPCallbacks(), clang::tidy::bugprone::ImplicitWideningOfMultiplicationResultCheck::registerPPCallbacks(), clang::tidy::bugprone::LambdaFunctionNameCheck::registerPPCallbacks(), clang::tidy::bugprone::MacroParenthesesCheck::registerPPCallbacks(), clang::tidy::bugprone::MacroRepeatedSideEffectsCheck::registerPPCallbacks(), clang::tidy::bugprone::NotNullTerminatedResultCheck::registerPPCallbacks(), and clang::tidy::bugprone::SuspiciousIncludeCheck::registerPPCallbacks().
|
constexpr |
Definition at line 30 of file NotNullTerminatedResultCheck.cpp.
Referenced by isDestAndSrcEquals(), isFixedGivenLengthAndUnknownSrc(), isGivenLengthEqualToSrcLength(), isStringDataAndLength(), and clang::tidy::bugprone::NotNullTerminatedResultCheck::registerMatchers().
|
constexpr |
Definition at line 29 of file NotNullTerminatedResultCheck.cpp.
Referenced by isGivenLengthEqualToSrcLength(), and clang::tidy::bugprone::NotNullTerminatedResultCheck::registerMatchers().
|
static |
Definition at line 26 of file ReservedIdentifierCheck.cpp.
Referenced by getFailureInfoImpl().
|
constexpr |
Definition at line 24 of file NotNullTerminatedResultCheck.cpp.
Referenced by isKnownDest(), and clang::tidy::bugprone::NotNullTerminatedResultCheck::registerMatchers().
|
constexpr |
Definition at line 33 of file NotNullTerminatedResultCheck.cpp.
Referenced by getGivenLength(), isCorrectGivenLength(), isGivenLengthEqualToSrcLength(), and clang::tidy::bugprone::NotNullTerminatedResultCheck::registerMatchers().
|
staticconstexpr |
Definition at line 19 of file SignedCharMisuseCheck.cpp.
Referenced by clang::tidy::bugprone::SignedCharMisuseCheck::check().
|
constexpr |
Definition at line 32 of file NotNullTerminatedResultCheck.cpp.
Referenced by getGivenLength(), getStrlenExpr(), isFixedGivenLengthAndUnknownSrc(), isStringDataAndLength(), and clang::tidy::bugprone::NotNullTerminatedResultCheck::registerMatchers().