mirror of
https://github.com/github/codeql.git
synced 2025-12-23 12:16:33 +01:00
C++: Deprecate single-parameter 'getFieldExpr' and 'getElementExpr'.
This commit is contained in:
@@ -147,7 +147,7 @@ class LambdaCapture extends Locatable, @lambdacapture {
|
||||
*/
|
||||
Expr getInitializer() {
|
||||
exists(LambdaExpression lambda | this = lambda.getCapture(_) |
|
||||
result = lambda.getInitializer().getFieldExpr(this.getField())
|
||||
result = lambda.getInitializer().getAFieldExpr(this.getField())
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ class ClassAggregateLiteral extends AggregateLiteral {
|
||||
* This predicate may have multiple results since a field can be initialized
|
||||
* multiple times in the same initializer.
|
||||
*/
|
||||
Expr getFieldExpr(Field field) { result = this.getFieldExpr(field, _) }
|
||||
deprecated Expr getFieldExpr(Field field) { result = this.getFieldExpr(field, _) }
|
||||
|
||||
/**
|
||||
* Gets the expression within the aggregate literal that is used to initialize
|
||||
@@ -238,7 +238,7 @@ class ClassAggregateLiteral extends AggregateLiteral {
|
||||
(
|
||||
// If the field has an explicit initializer expression, then the field is
|
||||
// initialized.
|
||||
exists(this.getFieldExpr(field))
|
||||
exists(this.getAFieldExpr(field))
|
||||
or
|
||||
// If the type is not a union, all fields without initializers are value
|
||||
// initialized.
|
||||
@@ -262,7 +262,7 @@ class ClassAggregateLiteral extends AggregateLiteral {
|
||||
pragma[inline]
|
||||
predicate isValueInitialized(Field field) {
|
||||
this.isInitialized(field) and
|
||||
not exists(this.getFieldExpr(field))
|
||||
not exists(this.getAFieldExpr(field))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ class ArrayOrVectorAggregateLiteral extends AggregateLiteral {
|
||||
* This predicate may have multiple results since an element can be initialized
|
||||
* multiple times in the same initializer.
|
||||
*/
|
||||
Expr getElementExpr(int elementIndex) { result = this.getElementExpr(elementIndex, _) }
|
||||
deprecated Expr getElementExpr(int elementIndex) { result = this.getElementExpr(elementIndex, _) }
|
||||
|
||||
/**
|
||||
* Gets the expression within the aggregate literal that is used to initialize
|
||||
|
||||
Reference in New Issue
Block a user