Skip to content

Commit

Permalink
Merge pull request #16289 from jketema/reuse-improve
Browse files Browse the repository at this point in the history
C++: Improve handling of re-use expressions
  • Loading branch information
jketema committed Apr 22, 2024
2 parents 874d9d1 + bcde715 commit c5bdd5b
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll
Original file line number Diff line number Diff line change
Expand Up @@ -1371,17 +1371,7 @@ class ReuseExpr extends Expr, @reuseexpr {
/**
* Gets the expression that is being re-used.
*/
Expr getReusedExpr() {
// In the case of a prvalue, the extractor outputs the expression
// before conversion, but the converted expression is intended.
if this.isPRValueCategory()
then result = this.getBaseReusedExpr().getFullyConverted()
else result = this.getBaseReusedExpr()
}

private Expr getBaseReusedExpr() {
expr_reuse(underlyingElement(this), unresolveElement(result), _)
}
Expr getReusedExpr() { expr_reuse(underlyingElement(this), unresolveElement(result), _) }

override Type getType() { result = this.getReusedExpr().getType() }

Expand Down

0 comments on commit c5bdd5b

Please sign in to comment.