Skip to content

Add lvalue DeclRefExprs to variable set for diagnosing free variables #909

Closed
@kkjeer

Description

@kkjeer

Currently in #903, getting the set of all variables involved in an expression constructs an LValueToRValue ImplicitCastExpr for each variable to add to the set. This is done so that the expressions in the set are rvalues and can later be compared with other rvalue expressions in CheckingState.EquivExprs. We want to avoid constructing these ImplicitCastExprs.

CollectVariableSetHelper should collect a set of DeclRefExprs. To check whether there is a set in CheckingState.EquivExprs that contains an lvalue variable v, search each expression e in each set F in CheckingState.EquivExprs to see if e is an LValueToRValue cast of v. The IsRValueCastOfVariable(e, v) method can be used to check this.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions