clang-tools  4.0.0
Classes | Functions | Variables
clang::tidy::misc Namespace Reference

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  DanglingHandleCheck
 Detect dangling references in value handlers like std::experimental::string_view. More...
 
class  DefinitionsInHeadersCheck
 Finds non-extern non-inline function and variable definitions in header files, which can lead to potential ODR violations. 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  IncorrectRoundings
 Checks the usage of patterns known to produce incorrect rounding. More...
 
class  InefficientAlgorithmCheck
 Warns on inefficient use of STL algorithms on associative containers. 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  MiscModule
 
class  MisplacedConstCheck
 This check diagnoses when a const qualifier is applied to a typedef to a pointer type rather than to the pointee. More...
 
class  MisplacedWideningCastCheck
 Find casts of calculation results to bigger type. More...
 
class  MoveConstantArgumentCheck
 
class  MoveConstructorInitCheck
 The check flags user-defined move constructors that have a ctor-initializer initializing a member or base class through a copy constructor instead of a move constructor. 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  NewDeleteOverloadsCheck
 
class  NoexceptMoveConstructorCheck
 The check flags user-defined move constructors and assignment operators not marked with noexcept or marked with noexcept(expr) where expr evaluates to false (but is not a false literal itself). More...
 
class  NonCopyableObjectsCheck
 The check flags dereferences and non-pointer declarations of objects that are not meant to be passed by value, such as C FILE objects. More...
 
class  RedundantExpressionCheck
 Detect useless or suspicious redundant expressions. More...
 
class  SizeofContainerCheck
 Find usages of sizeof on expressions of STL container types. More...
 
class  SizeofExpressionCheck
 Find suspicious usages of sizeof expression. More...
 
class  StaticAssertCheck
 Replaces assert() with static_assert() if the condition is evaluatable at compile time. More...
 
class  StringCompareCheck
 This check flags all calls compare when used to check for string equality or inequality. 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...
 
struct  ValueRange
 Stores a min and a max value which describe an interval. More...
 
class  SuspiciousEnumUsageCheck
 The checker detects various cases when an enum is probably misused (as a bitmask). More...
 
class  SuspiciousMissingCommaCheck
 This check finds string literals which are probably concatenated accidentally. 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  ThrowByValueCatchByReferenceCheck
 checks for locations that do not throw by value More...
 
class  UnconventionalAssignOperatorCheck
 Finds declarations of assignment operators with the wrong return and/or argument types and definitions with good return type but wrong return statements. 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  UniqueptrResetReleaseCheck
 Find and replace unique_ptr::reset(release()) with std::move(). More...
 
class  UnusedAliasDeclsCheck
 Finds unused namespace alias declarations. More...
 
class  UnusedParametersCheck
 Finds unused parameters and fixes them, so that -Wunused-parameter can be turned on. More...
 
class  UnusedRAIICheck
 Finds temporaries that look like RAII objects. More...
 
class  UnusedUsingDeclsCheck
 Finds unused using declarations. 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 bool sameName (StringRef InComment, StringRef InDecl, bool StrictMode)
 
*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 bool areTypesCompatible (QualType Left, QualType Right)
 
static bool isSurroundedLeft (const Token &T)
 Is argument surrounded properly with parentheses/braces/squares/commas? More...
 
static bool isSurroundedRight (const Token &T)
 Is argument surrounded properly with parentheses/braces/squares/commas? More...
 
static bool isKeyword (const Token &T)
 Is given TokenKind a keyword? More...
 
static bool isWarnOp (const Token &T)
 Warning is written when one of these operators are not within parentheses. More...
 
static bool isVarDeclKeyword (const Token &T)
 Is given Token a keyword that is used in variable declarations? More...
 
static bool possibleVarDecl (const MacroInfo *MI, const Token *Tok)
 Is there a possible variable declaration at Tok? More...
 
static QualType guessAlternateQualification (ASTContext &Context, QualType QT)
 
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 ReplaceCallWithArg (const CallExpr *Call, DiagnosticBuilder &Diag, const SourceManager &SM, const LangOptions &LangOpts)
 
static void replaceMoveWithForward (const UnresolvedLookupExpr *Callee, const ParmVarDecl *ParmVar, const TemplateTypeParmDecl *TypeParmDecl, DiagnosticBuilder &Diag, const ASTContext &Context)
 
static bool incrementWithoutOverflow (const APSInt &Value, APSInt &Result)
 
static bool areEquivalentNameSpecifier (const NestedNameSpecifier *Left, const NestedNameSpecifier *Right)
 
static bool areEquivalentExpr (const Expr *Left, const Expr *Right)
 
static bool areEquivalentRanges (BinaryOperatorKind OpcodeLHS, const APSInt &ValueLHS, BinaryOperatorKind OpcodeRHS, const APSInt &ValueRHS)
 
static bool areExclusiveRanges (BinaryOperatorKind OpcodeLHS, const APSInt &ValueLHS, BinaryOperatorKind OpcodeRHS, const APSInt &ValueRHS)
 
static bool rangesFullyCoverDomain (BinaryOperatorKind OpcodeLHS, const APSInt &ValueLHS, BinaryOperatorKind OpcodeRHS, const APSInt &ValueRHS)
 
static bool rangeSubsumesRange (BinaryOperatorKind OpcodeLHS, const APSInt &ValueLHS, BinaryOperatorKind OpcodeRHS, const APSInt &ValueRHS)
 
static void canonicalNegateExpr (BinaryOperatorKind &Opcode, APSInt &Value)
 
 AST_MATCHER (Expr, isIntegerConstantExpr)
 
static
ast_matchers::internal::Matcher
< Expr > 
matchIntegerConstantExpr (StringRef Id)
 
static bool retrieveIntegerConstantExpr (const MatchFinder::MatchResult &Result, StringRef Id, APSInt &Value)
 
static
ast_matchers::internal::Matcher
< Expr > 
matchSymbolicExpr (StringRef Id)
 
static bool retrieveSymbolicExpr (const MatchFinder::MatchResult &Result, StringRef Id, const Expr *&SymExpr)
 
static
ast_matchers::internal::Matcher
< Expr > 
matchBinOpIntegerConstantExpr (StringRef Id)
 
static bool retrieveBinOpIntegerConstantExpr (const MatchFinder::MatchResult &Result, StringRef Id, BinaryOperatorKind &Opcode, const Expr *&Symbol, APSInt &Value)
 
static
ast_matchers::internal::Matcher
< Expr > 
matchRelationalIntegerConstantExpr (StringRef Id)
 
static bool retrieveRelationalIntegerConstantExpr (const MatchFinder::MatchResult &Result, StringRef Id, const Expr *&OperandExpr, BinaryOperatorKind &Opcode, const Expr *&Symbol, APSInt &Value)
 
 AST_MATCHER (BinaryOperator, operandsAreEquivalent)
 
 AST_MATCHER (ConditionalOperator, expressionsAreEquivalent)
 
 AST_MATCHER (CallExpr, parametersAreEquivalent)
 
 AST_MATCHER (BinaryOperator, binaryOperatorIsInMacro)
 
 AST_MATCHER (ConditionalOperator, conditionalOperatorIsInMacro)
 
 AST_MATCHER (Expr, isMacro)
 
 AST_MATCHER_P (Expr, expandedByMacro, std::set< std::string >, Names)
 
 AST_MATCHER_P (IntegerLiteral, isBiggerThan, unsigned, N)
 
 AST_MATCHER (StringLiteral, containsNul)
 
static int enumLength (const EnumDecl *EnumDec)
 Return the number of EnumConstantDecls in an EnumDecl. More...
 
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. More...
 
static const Expr * ignoreNoOpCasts (const Expr *E)
 Look through lvalue to rvalue and nop casts. More...
 
static bool isImplicitCastCandidate (const CastExpr *Cast)
 Restrict the warning to implicit casts that are most likely accidental. More...
 
template<typename T >
static CharSourceRange removeNode (const MatchFinder::MatchResult &Result, const T *PrevNode, const T *Node, const T *NextNode)
 
static FixItHint removeParameter (const MatchFinder::MatchResult &Result, const FunctionDecl *Function, unsigned Index)
 
static FixItHint removeArgument (const MatchFinder::MatchResult &Result, const CallExpr *Call, unsigned Index)
 
static bool ShouldCheckDecl (const Decl *TargetDecl)
 
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...
 

Variables

static const char KnownBannedMacroNames []
 
static const StringRef CompareMessage
 
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 []
 

Function Documentation

static bool clang::tidy::misc::areEquivalentExpr ( const Expr *  Left,
const Expr *  Right 
)
static

Definition at line 58 of file RedundantExpressionCheck.cpp.

References areEquivalentNameSpecifier().

Referenced by AST_MATCHER().

static bool clang::tidy::misc::areEquivalentNameSpecifier ( const NestedNameSpecifier *  Left,
const NestedNameSpecifier *  Right 
)
static

Definition at line 50 of file RedundantExpressionCheck.cpp.

Referenced by areEquivalentExpr().

static bool clang::tidy::misc::areEquivalentRanges ( BinaryOperatorKind  OpcodeLHS,
const APSInt &  ValueLHS,
BinaryOperatorKind  OpcodeRHS,
const APSInt &  ValueRHS 
)
static

Definition at line 139 of file RedundantExpressionCheck.cpp.

References incrementWithoutOverflow().

static bool clang::tidy::misc::areExclusiveRanges ( BinaryOperatorKind  OpcodeLHS,
const APSInt &  ValueLHS,
BinaryOperatorKind  OpcodeRHS,
const APSInt &  ValueRHS 
)
static

Definition at line 159 of file RedundantExpressionCheck.cpp.

References incrementWithoutOverflow().

static bool clang::tidy::misc::areTypesCompatible ( QualType  Left,
QualType  Right 
)
static
clang::tidy::misc::AST_MATCHER ( StringLiteral  ,
containsNul   
)

Definition at line 20 of file StringLiteralWithEmbeddedNulCheck.cpp.

clang::tidy::misc::AST_MATCHER ( CXXMethodDecl  ,
isStatic   
)

Definition at line 22 of file VirtualNearMissCheck.cpp.

clang::tidy::misc::AST_MATCHER ( CXXMethodDecl  ,
isOverloadedOperator   
)

Definition at line 24 of file VirtualNearMissCheck.cpp.

clang::tidy::misc::AST_MATCHER ( Expr  ,
isIntegerConstantExpr   
)

Definition at line 287 of file RedundantExpressionCheck.cpp.

References Finder.

clang::tidy::misc::AST_MATCHER ( BinaryOperator  ,
operandsAreEquivalent   
)

Definition at line 433 of file RedundantExpressionCheck.cpp.

References areEquivalentExpr().

clang::tidy::misc::AST_MATCHER ( ConditionalOperator  ,
expressionsAreEquivalent   
)

Definition at line 437 of file RedundantExpressionCheck.cpp.

References areEquivalentExpr().

clang::tidy::misc::AST_MATCHER ( CallExpr  ,
parametersAreEquivalent   
)

Definition at line 441 of file RedundantExpressionCheck.cpp.

References areEquivalentExpr().

clang::tidy::misc::AST_MATCHER ( BinaryOperator  ,
binaryOperatorIsInMacro   
)

Definition at line 446 of file RedundantExpressionCheck.cpp.

clang::tidy::misc::AST_MATCHER ( ConditionalOperator  ,
conditionalOperatorIsInMacro   
)

Definition at line 450 of file RedundantExpressionCheck.cpp.

clang::tidy::misc::AST_MATCHER ( Expr  ,
isMacro   
)

Definition at line 454 of file RedundantExpressionCheck.cpp.

clang::tidy::misc::AST_MATCHER_P ( IntegerLiteral  ,
isBiggerThan  ,
unsigned  ,
 
)

Definition at line 21 of file StringConstructorCheck.cpp.

clang::tidy::misc::AST_MATCHER_P ( Expr  ,
expandedByMacro  ,
std::set< std::string >  ,
Names   
)

Definition at line 456 of file RedundantExpressionCheck.cpp.

References Finder, Loc, and SM.

static void clang::tidy::misc::canonicalNegateExpr ( BinaryOperatorKind &  Opcode,
APSInt &  Value 
)
static

Definition at line 280 of file RedundantExpressionCheck.cpp.

static bool clang::tidy::misc::checkOverrideByDerivedMethod ( const CXXMethodDecl *  BaseMD,
const CXXMethodDecl *  DerivedMD 
)
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.

static bool clang::tidy::misc::checkOverrideWithoutName ( const ASTContext *  Context,
const CXXMethodDecl *  BaseMD,
const CXXMethodDecl *  DerivedMD 
)
static
Returns
true if derived method can override base method except for the name.

Definition at line 148 of file VirtualNearMissCheck.cpp.

References checkOverridingFunctionReturnType(), and checkParamTypes().

Referenced by clang::tidy::misc::VirtualNearMissCheck::check().

static bool clang::tidy::misc::checkOverridingFunctionReturnType ( const ASTContext *  Context,
const CXXMethodDecl *  BaseMD,
const CXXMethodDecl *  DerivedMD 
)
static

Checks whether the return types are covariant, according to C++[class.virtual]p7.

Similar with clang::Sema::CheckOverridingFunctionReturnType.

Returns
true if the return types of BaseMD and DerivedMD are covariant.

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.

References Path.

Referenced by checkOverrideWithoutName().

static bool clang::tidy::misc::checkParamTypes ( const CXXMethodDecl *  BaseMD,
const CXXMethodDecl *  DerivedMD 
)
static
Returns
true if the param types are the same.

Definition at line 130 of file VirtualNearMissCheck.cpp.

References getDecayedType().

Referenced by checkOverrideWithoutName().

static int clang::tidy::misc::countNonPowOfTwoLiteralNum ( const EnumDecl *  EnumDec)
static

Definition at line 88 of file SuspiciousEnumUsageCheck.cpp.

References isNonPowerOf2NorNullLiteral().

Referenced by isPossiblyBitMask().

static void clang::tidy::misc::emitDiagnostic ( const Expr *  MovingCall,
const DeclRefExpr *  MoveArg,
const UseAfterMove &  Use,
ClangTidyCheck *  Check,
ASTContext *  Context 
)
static
static int clang::tidy::misc::enumLength ( const EnumDecl *  EnumDec)
static

Return the number of EnumConstantDecls in an EnumDecl.

Definition at line 53 of file SuspiciousEnumUsageCheck.cpp.

Referenced by isPossiblyBitMask().

* that are placed right before the argument* * code* void clang::tidy::misc::f ( bool  foo)

Checks that argument comments match parameter names.

The check understands argument comments in the form `/*parameter_name=

* * * clang::tidy::misc::f ( true  )
static std::vector<std::pair<SourceLocation, StringRef> > clang::tidy::misc::getCommentsInRange ( ASTContext *  Ctx,
CharSourceRange  Range 
)
static

Definition at line 46 of file ArgumentCommentCheck.cpp.

References SM.

static QualType clang::tidy::misc::getDecayedType ( QualType  Type)
static
Returns
decayed type for arrays and functions.

Definition at line 123 of file VirtualNearMissCheck.cpp.

Referenced by checkParamTypes().

static unsigned clang::tidy::misc::getMaxCalculationWidth ( const ASTContext &  Context,
const Expr *  E 
)
static
static std::string clang::tidy::misc::getNameOfNamespace ( const CXXRecordDecl *  Decl)
static
static QualType clang::tidy::misc::guessAlternateQualification ( ASTContext &  Context,
QualType  QT 
)
static
static bool clang::tidy::misc::hasDisjointValueRange ( const EnumDecl *  Enum1,
const EnumDecl *  Enum2 
)
static
static bool clang::tidy::misc::haveSameNamespaceOrTranslationUnit ( const CXXRecordDecl *  Decl1,
const CXXRecordDecl *  Decl2 
)
static
static const Expr* clang::tidy::misc::ignoreNoOpCasts ( const Expr *  E)
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 29 of file SwappedArgumentsCheck.cpp.

Referenced by clang::tidy::misc::SwappedArgumentsCheck::check().

static bool clang::tidy::misc::incrementWithoutOverflow ( const APSInt &  Value,
APSInt &  Result 
)
static

Definition at line 44 of file RedundantExpressionCheck.cpp.

References Result.

Referenced by areEquivalentRanges(), areExclusiveRanges(), and rangesFullyCoverDomain().

static StatementMatcher clang::tidy::misc::inDecltypeOrTemplateArg ( )
static
static bool clang::tidy::misc::isFirstWider ( BuiltinType::Kind  First,
BuiltinType::Kind  Second 
)
static
static bool clang::tidy::misc::isImplicitCastCandidate ( const CastExpr *  Cast)
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 40 of file SwappedArgumentsCheck.cpp.

Referenced by clang::tidy::misc::SwappedArgumentsCheck::check().

static bool clang::tidy::misc::isKeyword ( const Token &  T)
static

Is given TokenKind a keyword?

Definition at line 56 of file MacroParenthesesCheck.cpp.

static bool clang::tidy::misc::isMaxValAllBitSetLiteral ( const EnumDecl *  EnumDec)
static

Definition at line 73 of file SuspiciousEnumUsageCheck.cpp.

Referenced by isPossiblyBitMask().

static bool clang::tidy::misc::isNonPowerOf2NorNullLiteral ( const EnumConstantDecl *  EnumConst)
static

Definition at line 63 of file SuspiciousEnumUsageCheck.cpp.

Referenced by countNonPowOfTwoLiteralNum().

static bool clang::tidy::misc::isOverrideMethod ( const CXXMethodDecl *  MD)
static

Finds out if the given method overrides some method.

Definition at line 29 of file VirtualNearMissCheck.cpp.

static bool clang::tidy::misc::isPossiblyBitMask ( const EnumDecl *  EnumDec)
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 99 of file SuspiciousEnumUsageCheck.cpp.

References countNonPowOfTwoLiteralNum(), enumLength(), isMaxValAllBitSetLiteral(), clang::tidy::misc::ValueRange::MaxVal, and clang::tidy::misc::ValueRange::MinVal.

Referenced by clang::tidy::misc::SuspiciousEnumUsageCheck::check().

bool clang::tidy::misc::isStandardSmartPointer ( const ValueDecl *  VD)

Definition at line 208 of file UseAfterMoveCheck.cpp.

References Name.

static bool clang::tidy::misc::isSurroundedLeft ( const Token &  T)
static

Is argument surrounded properly with parentheses/braces/squares/commas?

Definition at line 44 of file MacroParenthesesCheck.cpp.

static bool clang::tidy::misc::isSurroundedRight ( const Token &  T)
static

Is argument surrounded properly with parentheses/braces/squares/commas?

Definition at line 50 of file MacroParenthesesCheck.cpp.

static bool clang::tidy::misc::isValidBuiltinFold ( const BuiltinType &  ValueType,
const BuiltinType &  InitType,
const ASTContext &  Context 
)
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 bool clang::tidy::misc::isVarDeclKeyword ( const Token &  T)
static

Is given Token a keyword that is used in variable declarations?

Definition at line 70 of file MacroParenthesesCheck.cpp.

Referenced by possibleVarDecl().

static bool clang::tidy::misc::isWarnOp ( const Token &  T)
static

Warning is written when one of these operators are not within parentheses.

Definition at line 62 of file MacroParenthesesCheck.cpp.

static ast_matchers::internal::Matcher<Expr> clang::tidy::misc::matchBinOpIntegerConstantExpr ( StringRef  Id)
static
static ast_matchers::internal::Matcher<Expr> clang::tidy::misc::matchIntegerConstantExpr ( StringRef  Id)
static
static ast_matchers::internal::Matcher<Expr> clang::tidy::misc::matchRelationalIntegerConstantExpr ( StringRef  Id)
static
static ast_matchers::internal::Matcher<Expr> clang::tidy::misc::matchSymbolicExpr ( StringRef  Id)
static
static bool clang::tidy::misc::possibleVarDecl ( const MacroInfo *  MI,
const Token *  Tok 
)
static

Is there a possible variable declaration at Tok?

Definition at line 78 of file MacroParenthesesCheck.cpp.

References isVarDeclKeyword().

static bool clang::tidy::misc::rangesFullyCoverDomain ( BinaryOperatorKind  OpcodeLHS,
const APSInt &  ValueLHS,
BinaryOperatorKind  OpcodeRHS,
const APSInt &  ValueRHS 
)
static

Definition at line 203 of file RedundantExpressionCheck.cpp.

References incrementWithoutOverflow().

static bool clang::tidy::misc::rangeSubsumesRange ( BinaryOperatorKind  OpcodeLHS,
const APSInt &  ValueLHS,
BinaryOperatorKind  OpcodeRHS,
const APSInt &  ValueRHS 
)
static

Definition at line 245 of file RedundantExpressionCheck.cpp.

static int clang::tidy::misc::relativeCharSizes ( BuiltinType::Kind  Kind)
static

Definition at line 132 of file MisplacedWideningCastCheck.cpp.

Referenced by isFirstWider().

static int clang::tidy::misc::relativeCharSizesW ( BuiltinType::Kind  Kind)
static

Definition at line 151 of file MisplacedWideningCastCheck.cpp.

Referenced by isFirstWider().

static int clang::tidy::misc::relativeIntSizes ( BuiltinType::Kind  Kind)
static

Definition at line 97 of file MisplacedWideningCastCheck.cpp.

Referenced by isFirstWider().

static FixItHint clang::tidy::misc::removeArgument ( const MatchFinder::MatchResult &  Result,
const CallExpr *  Call,
unsigned  Index 
)
static

Definition at line 60 of file UnusedParametersCheck.cpp.

References removeNode().

template<typename T >
static CharSourceRange clang::tidy::misc::removeNode ( const MatchFinder::MatchResult &  Result,
const T *  PrevNode,
const T *  Node,
const T *  NextNode 
)
static

Definition at line 34 of file UnusedParametersCheck.cpp.

Referenced by removeArgument(), and removeParameter().

static FixItHint clang::tidy::misc::removeParameter ( const MatchFinder::MatchResult &  Result,
const FunctionDecl *  Function,
unsigned  Index 
)
static

Definition at line 51 of file UnusedParametersCheck.cpp.

References removeNode().

static void clang::tidy::misc::ReplaceCallWithArg ( const CallExpr *  Call,
DiagnosticBuilder &  Diag,
const SourceManager &  SM,
const LangOptions &  LangOpts 
)
static
static void clang::tidy::misc::replaceMoveWithForward ( const UnresolvedLookupExpr *  Callee,
const ParmVarDecl *  ParmVar,
const TemplateTypeParmDecl *  TypeParmDecl,
DiagnosticBuilder &  Diag,
const ASTContext &  Context 
)
static
static bool clang::tidy::misc::retrieveBinOpIntegerConstantExpr ( const MatchFinder::MatchResult &  Result,
StringRef  Id,
BinaryOperatorKind &  Opcode,
const Expr *&  Symbol,
APSInt &  Value 
)
static
static bool clang::tidy::misc::retrieveIntegerConstantExpr ( const MatchFinder::MatchResult &  Result,
StringRef  Id,
APSInt &  Value 
)
static
static bool clang::tidy::misc::retrieveRelationalIntegerConstantExpr ( const MatchFinder::MatchResult &  Result,
StringRef  Id,
const Expr *&  OperandExpr,
BinaryOperatorKind &  Opcode,
const Expr *&  Symbol,
APSInt &  Value 
)
static
static bool clang::tidy::misc::retrieveSymbolicExpr ( const MatchFinder::MatchResult &  Result,
StringRef  Id,
const Expr *&  SymExpr 
)
static
static bool clang::tidy::misc::sameName ( StringRef  InComment,
StringRef  InDecl,
bool  StrictMode 
)
static

Definition at line 119 of file ArgumentCommentCheck.cpp.

static bool clang::tidy::misc::ShouldCheckDecl ( const Decl *  TargetDecl)
static

Variable Documentation

const char clang::tidy::misc::BitmaskErrorMessage[]
static
Initial value:
=
"enum type seems like a bitmask (contains mostly "
"power-of-2 literals), but this literal is not a "
"power-of-2"

Definition at line 24 of file SuspiciousEnumUsageCheck.cpp.

const char clang::tidy::misc::BitmaskNoteMessage[] = "used here as a bitmask"
static

Definition at line 34 of file SuspiciousEnumUsageCheck.cpp.

const char clang::tidy::misc::BitmaskVarErrorMessage[]
static
Initial value:
=
"enum type seems like a bitmask (contains mostly "
"power-of-2 literals) but %plural{1:a literal is|:some literals are}0 not "
"power-of-2"

Definition at line 29 of file SuspiciousEnumUsageCheck.cpp.

const StringRef clang::tidy::misc::CompareMessage
static
Initial value:
= "do not use 'compare' to test equality "
"of strings; use the string equality "
"operator instead"

Definition at line 22 of file StringCompareCheck.cpp.

Referenced by clang::tidy::misc::StringCompareCheck::check().

const char clang::tidy::misc::DifferentEnumErrorMessage[]
static
Initial value:
=
"enum values are from different enum types"

Definition at line 21 of file SuspiciousEnumUsageCheck.cpp.

Referenced by clang::tidy::misc::SuspiciousEnumUsageCheck::check().

const char clang::tidy::misc::KnownBannedMacroNames[]
static
Initial value:
=
"EAGAIN;EWOULDBLOCK;SIGCLD;SIGCHLD;"

Definition at line 41 of file RedundantExpressionCheck.cpp.

Referenced by clang::tidy::misc::RedundantExpressionCheck::registerMatchers().

const char clang::tidy::misc::KnownStringCompareFunctions[]
static