Query module ExprHasNoEffect

name
Expression has no effect
description
A pure expression whose value is ignored is likely to be the result of a typo.
kind
problem
problem.severity
warning
precision
high
id
cpp/useless-expression
tags
maintainability correctness external/cwe/cwe-561

Imports

cpp

Provides classes and predicates for working with C/C++/ObjC/ObjC++ code.

Predicates

accessInInitOfForStmt
containsDisabledCode

Holds if the function f, or a function called by it, contains code excluded by the preprocessor.

definedInIfDef

Holds if the function f, or a function called by it, is inside a preprocessor branch that may have code in another arm

functionLocation

Holds if the body of the function f is on lines fBlockStartLine to fBlockEndLine in file file.

pbdLocation

Holds if the preprocessor branch pbd is on line pbdStartLine in file file.

Classes