Cppcheck
Classes | Functions | Variables
checkunusedvar.cpp File Reference
#include "checkunusedvar.h"
#include "astutils.h"
#include "errortypes.h"
#include "fwdanalysis.h"
#include "library.h"
#include "settings.h"
#include "symboldatabase.h"
#include "token.h"
#include "tokenize.h"
#include "utils.h"
#include "valueflow.h"
#include <algorithm>
#include <list>
#include <set>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

class  Variables
 This class is used create a list of variables within a function. More...
 
class  Variables::VariableUsage
 Store information about variable usage. More...
 

Functions

static bool isRaiiClassScope (const Scope *classScope)
 Is scope a raii class scope. More...
 
static bool isRaiiClass (const ValueType *valueType, bool cpp, bool defaultReturn=true)
 Is ValueType a raii class? More...
 
static const TokendoAssignment (Variables &variables, const Token *tok, bool dereference, const Scope *scope)
 
static bool isPartOfClassStructUnion (const Token *tok)
 
static bool isVarDecl (const Token *tok)
 
static const TokenskipBrackets (const Token *tok)
 
static const TokenskipBracketsAndMembers (const Token *tok)
 
static void useFunctionArgs (const Token *tok, Variables &variables)
 

Variables

static const CWE CWE563 (563U)
 
static const CWE CWE665 (665U)
 

Function Documentation

◆ doAssignment()

static const Token* doAssignment ( Variables variables,
const Token tok,
bool  dereference,
const Scope scope 
)
static

◆ isPartOfClassStructUnion()

static bool isPartOfClassStructUnion ( const Token tok)
static

◆ isRaiiClass()

static bool isRaiiClass ( const ValueType valueType,
bool  cpp,
bool  defaultReturn = true 
)
static

◆ isRaiiClassScope()

static bool isRaiiClassScope ( const Scope classScope)
static

Is scope a raii class scope.

Definition at line 50 of file checkunusedvar.cpp.

References Scope::getDestructor().

Referenced by isRaiiClass().

◆ isVarDecl()

static bool isVarDecl ( const Token tok)
static

◆ skipBrackets()

static const Token* skipBrackets ( const Token tok)
static

◆ skipBracketsAndMembers()

static const Token* skipBracketsAndMembers ( const Token tok)
static

◆ useFunctionArgs()

static void useFunctionArgs ( const Token tok,
Variables variables 
)
static

Variable Documentation

◆ CWE563

const CWE CWE563(563U) ( 563U  )
static

◆ CWE665

const CWE CWE665(665U) ( 665U  )
static