clang-tools
6.0.0
|
Classes | |
class | ArgumentCommentCheck |
class | AssertSideEffectCheck |
Finds assert() with side effect. More... | |
class | BoolPointerImplicitConversionCheck |
Checks for conditions based on implicit conversion from a bool pointer to bool. More... | |
class | BugproneModule |
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 | 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 | InaccurateEraseCheck |
Checks for inaccurate use of the erase() method. More... | |
class | IntegerDivisionCheck |
Finds cases where integer division in a floating point context is likely to cause unintended loss of precision. 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 | MoveForwardingReferenceCheck |
The check warns if std::move is applied to a forwarding reference (i.e. More... | |
class | MultipleStatementMacroCheck |
Detect multiple statement macros that are used in unbraced conditionals. More... | |
class | StringConstructorCheck |
Finds suspicious string constructor and check their parameters. More... | |
class | SuspiciousMemsetUsageCheck |
Finds memset calls with potential mistakes in their arguments. More... | |
class | UndefinedMemoryManipulationCheck |
Finds calls of memory manipulation functions memset() , memcpy() and memmove() on not TriviallyCopyable objects resulting in undefined behavior. More... | |
class | UseAfterMoveCheck |
The check warns if an object is used after it has been moved, without an intervening reinitialization. More... | |
class | VirtualNearMissCheck |
Checks for near miss of virtual methods. More... | |
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) |
*that are placed right before the argument **code *void | f (bool foo) |
Checks that argument comments match parameter names. More... | |
*** | f (true) |
static bool | isValidBuiltinFold (const BuiltinType &ValueType, const BuiltinType &InitType, const ASTContext &Context) |
Returns true if ValueType is allowed to fold into InitType, i.e. More... | |
static bool | haveSameNamespaceOrTranslationUnit (const CXXRecordDecl *Decl1, const CXXRecordDecl *Decl2) |
static std::string | getNameOfNamespace (const CXXRecordDecl *Decl) |
static void | replaceMoveWithForward (const UnresolvedLookupExpr *Callee, const ParmVarDecl *ParmVar, const TemplateTypeParmDecl *TypeParmDecl, DiagnosticBuilder &Diag, const ASTContext &Context) |
AST_MATCHER_P (IntegerLiteral, isBiggerThan, unsigned, N) | |
static StatementMatcher | inDecltypeOrTemplateArg () |
bool | isStandardSmartPointer (const ValueDecl *VD) |
static void | emitDiagnostic (const Expr *MovingCall, const DeclRefExpr *MoveArg, const UseAfterMove &Use, ClangTidyCheck *Check, ASTContext *Context) |
AST_MATCHER (CXXMethodDecl, isStatic) | |
AST_MATCHER (CXXMethodDecl, isOverloadedOperator) | |
static bool | isOverrideMethod (const CXXMethodDecl *MD) |
Finds out if the given method overrides some method. More... | |
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. More... | |
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. More... | |
|
static |
Definition at line 155 of file ArgumentCommentCheck.cpp.
References looksLikeExpectMethod().
Referenced by findMockedMethod().
clang::tidy::bugprone::AST_MATCHER | ( | CXXMethodDecl | , |
isStatic | |||
) |
Definition at line 22 of file VirtualNearMissCheck.cpp.
clang::tidy::bugprone::AST_MATCHER | ( | CXXMethodDecl | , |
isOverloadedOperator | |||
) |
Definition at line 24 of file VirtualNearMissCheck.cpp.
clang::tidy::bugprone::AST_MATCHER_P | ( | IntegerLiteral | , |
isBiggerThan | , | ||
unsigned | , | ||
N | |||
) |
Definition at line 21 of file StringConstructorCheck.cpp.
|
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 168 of file VirtualNearMissCheck.cpp.
References isOverrideMethod().
|
static |
Definition at line 148 of file VirtualNearMissCheck.cpp.
|
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 38 of file VirtualNearMissCheck.cpp.
|
static |
Definition at line 130 of file VirtualNearMissCheck.cpp.
References getDecayedType().
|
static |
Definition at line 351 of file UseAfterMoveCheck.cpp.
Referenced by clang::tidy::bugprone::UseAfterMoveCheck::check().
* that are placed right before the argument* * code* void clang::tidy::bugprone::f | ( | bool | foo | ) |
Checks that argument comments match parameter names.
The check understands argument comments in the form `/*parameter_name=
* * * clang::tidy::bugprone::f | ( | true | ) |
|
static |
Definition at line 170 of file ArgumentCommentCheck.cpp.
References areMockAndExpectMethods(), and looksLikeExpectMethod().
Referenced by resolveMocks().
|
static |
Definition at line 91 of file ArgumentCommentCheck.cpp.
References clang::tidy::utils::lexer::getPreviousToken().
Referenced by resolveMocks().
|
static |
Definition at line 47 of file ArgumentCommentCheck.cpp.
Referenced by resolveMocks().
|
static |
Definition at line 123 of file VirtualNearMissCheck.cpp.
Referenced by checkParamTypes().
|
static |
Definition at line 104 of file ForwardDeclarationNamespaceCheck.cpp.
Referenced by clang::tidy::bugprone::ForwardDeclarationNamespaceCheck::onEndOfTranslationUnit().
|
static |
Definition at line 83 of file ForwardDeclarationNamespaceCheck.cpp.
Referenced by clang::tidy::bugprone::ForwardDeclarationNamespaceCheck::onEndOfTranslationUnit().
|
static |
Definition at line 78 of file UseAfterMoveCheck.cpp.
|
static |
Definition at line 108 of file ArgumentCommentCheck.cpp.
Referenced by resolveMocks().
|
static |
Finds out if the given method overrides some method.
Definition at line 29 of file VirtualNearMissCheck.cpp.
Referenced by checkOverrideByDerivedMethod().
bool clang::tidy::bugprone::isStandardSmartPointer | ( | const ValueDecl * | VD | ) |
Definition at line 208 of file UseAfterMoveCheck.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 80 of file FoldInitTypeCheck.cpp.
|
static |
Definition at line 150 of file ArgumentCommentCheck.cpp.
Referenced by areMockAndExpectMethods(), and findMockedMethod().
|
static |
Definition at line 22 of file MoveForwardingReferenceCheck.cpp.
Referenced by clang::tidy::bugprone::MoveForwardingReferenceCheck::check().
|
static |
Definition at line 195 of file ArgumentCommentCheck.cpp.
References clang::tidy::ClangTidyCheck::diag(), findMockedMethod(), getCommentsBeforeLoc(), getCommentsInRange(), isLikelyTypo(), and sameName().
|
static |
Definition at line 141 of file ArgumentCommentCheck.cpp.
Referenced by resolveMocks().