clang-tools 20.0.0git
Classes | Namespaces | Functions | Variables
SuspiciousEnumUsageCheck.cpp File Reference
#include "SuspiciousEnumUsageCheck.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include <algorithm>

Go to the source code of this file.

Classes

struct  clang::tidy::bugprone::ValueRange
 Stores a min and a max value which describe an interval. More...
 

Namespaces

namespace  clang
 ===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
 
namespace  clang::tidy
 
namespace  clang::tidy::bugprone
 

Functions

static int clang::tidy::bugprone::enumLength (const EnumDecl *EnumDec)
 Return the number of EnumConstantDecls in an EnumDecl.
 
static bool clang::tidy::bugprone::hasDisjointValueRange (const EnumDecl *Enum1, const EnumDecl *Enum2)
 
static bool clang::tidy::bugprone::isNonPowerOf2NorNullLiteral (const EnumConstantDecl *EnumConst)
 
static bool clang::tidy::bugprone::isMaxValAllBitSetLiteral (const EnumDecl *EnumDec)
 
static int clang::tidy::bugprone::countNonPowOfTwoLiteralNum (const EnumDecl *EnumDec)
 
static bool clang::tidy::bugprone::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.
 

Variables

static const char clang::tidy::bugprone::DifferentEnumErrorMessage []
 
static const char clang::tidy::bugprone::BitmaskErrorMessage []
 
static const char clang::tidy::bugprone::BitmaskVarErrorMessage []
 
static const char clang::tidy::bugprone::BitmaskNoteMessage [] = "used here as a bitmask"