Skip to content

Commit 2c76b13

Browse files
committed
C++: Improve handling of re-used qualifier in delete expressions
1 parent 45b1a5e commit 2c76b13

File tree

1 file changed

+2
-11
lines changed
  • cpp/ql/lib/semmle/code/cpp/exprs

1 file changed

+2
-11
lines changed

cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import semmle.code.cpp.Element
66
private import semmle.code.cpp.Enclosing
77
private import semmle.code.cpp.internal.ResolveClass
88
private import semmle.code.cpp.internal.AddressConstantExpression
9+
private import semmle.code.cpp.internal.ExtractorVersion
910

1011
/**
1112
* A C/C++ expression.
@@ -1371,17 +1372,7 @@ class ReuseExpr extends Expr, @reuseexpr {
13711372
/**
13721373
* Gets the expression that is being re-used.
13731374
*/
1374-
Expr getReusedExpr() {
1375-
// In the case of a prvalue, the extractor outputs the expression
1376-
// before conversion, but the converted expression is intended.
1377-
if this.isPRValueCategory()
1378-
then result = this.getBaseReusedExpr().getFullyConverted()
1379-
else result = this.getBaseReusedExpr()
1380-
}
1381-
1382-
private Expr getBaseReusedExpr() {
1383-
expr_reuse(underlyingElement(this), unresolveElement(result), _)
1384-
}
1375+
Expr getReusedExpr() { expr_reuse(underlyingElement(this), unresolveElement(result), _) }
13851376

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

0 commit comments

Comments
 (0)