Skip to content

Commit c0ff962

Browse files
committed
Merge commit 'fddf627461e88c0a824b36b770497be3a370eb3d' into codeql/upgrade-to-2.13.5
2 parents a1a47cc + fddf627 commit c0ff962

File tree

23 files changed

+46
-47
lines changed

23 files changed

+46
-47
lines changed

c/cert/src/rules/EXP39-C/DoNotAccessVariableViaPointerOfIncompatibleType.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ Type compatibleTypes(Type type) {
163163
(
164164
type.stripType() instanceof Struct and
165165
type.getUnspecifiedType() = result.getUnspecifiedType() and
166-
not type.getName() = "struct <unnamed>" and
167-
not result.getName() = "struct <unnamed>"
166+
not type.(Struct).isAnonymous() and
167+
not result.(Struct).isAnonymous()
168168
or
169169
not type.stripType() instanceof Struct and
170170
(

c/cert/src/rules/FIO32-C/DoNotPerformFileOperationsOnDevices.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ module TaintedPathConfiguration implements DataFlow::ConfigSig {
8989
}
9090
}
9191

92-
module TaintedPath = TaintTracking::Make<TaintedPathConfiguration>;
92+
module TaintedPath = TaintTracking::Global<TaintedPathConfiguration>;
9393

9494
from
9595
FileFunction fileFunction, Expr taintedArg, FlowSource taintSource,
@@ -98,7 +98,7 @@ where
9898
not isExcluded(taintedArg, IO3Package::doNotPerformFileOperationsOnDevicesQuery()) and
9999
taintedArg = sinkNode.getNode().asIndirectArgument() and
100100
fileFunction.outermostWrapperFunctionCall(taintedArg, callChain) and
101-
TaintedPath::hasFlowPath(sourceNode, sinkNode) and
101+
TaintedPath::flowPath(sourceNode, sinkNode) and
102102
taintSource = sourceNode.getNode()
103103
select taintedArg, sourceNode, sinkNode,
104104
"This argument to a file access function is derived from $@ and then passed to " + callChain + ".",

c/cert/test/rules/EXP39-C/DoNotAccessVariableViaPointerOfIncompatibleType.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ subpaths
5353
| test.c:13:17:13:19 | & ... | test.c:13:17:13:19 | & ... | test.c:13:17:13:19 | & ... | Cast from short[2] to short[4] results in an incompatible pointer base type. |
5454
| test.c:19:18:19:20 | & ... | test.c:19:18:19:20 | & ... | test.c:19:18:19:20 | & ... | Cast from char to signed char results in an incompatible pointer base type. |
5555
| test.c:30:19:30:21 | & ... | test.c:30:19:30:21 | & ... | test.c:30:19:30:21 | & ... | Cast from int to unsigned int results in an incompatible pointer base type. |
56-
| test.c:47:8:47:9 | s2 | test.c:47:8:47:9 | s2 | test.c:47:8:47:9 | s2 | Cast from struct <unnamed> to struct <unnamed> results in an incompatible pointer base type. |
57-
| test.c:49:8:49:9 | s3 | test.c:49:8:49:9 | s3 | test.c:49:8:49:9 | s3 | Cast from S1 to struct <unnamed> results in an incompatible pointer base type. |
58-
| test.c:50:8:50:9 | s1 | test.c:50:8:50:9 | s1 | test.c:50:8:50:9 | s1 | Cast from struct <unnamed> to S1 results in an incompatible pointer base type. |
56+
| test.c:47:8:47:9 | s2 | test.c:47:8:47:9 | s2 | test.c:47:8:47:9 | s2 | Cast from (unnamed class/struct/union) to (unnamed class/struct/union) results in an incompatible pointer base type. |
57+
| test.c:49:8:49:9 | s3 | test.c:49:8:49:9 | s3 | test.c:49:8:49:9 | s3 | Cast from S1 to (unnamed class/struct/union) results in an incompatible pointer base type. |
58+
| test.c:50:8:50:9 | s1 | test.c:50:8:50:9 | s1 | test.c:50:8:50:9 | s1 | Cast from (unnamed class/struct/union) to S1 results in an incompatible pointer base type. |
5959
| test.c:68:41:68:41 | v | test.c:72:13:72:15 | & ... | test.c:68:41:68:41 | v | Cast from float to int results in an incompatible pointer base type. |
6060
| test.c:99:3:99:4 | s3 | test.c:98:40:98:41 | s2 | test.c:99:3:99:4 | s3 | Cast from S2 to S3 results in an incompatible pointer base type. |

c/common/test/rules/informationleakageacrossboundaries/InformationLeakageAcrossBoundaries.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
| interprocedural.c:104:9:104:9 | p | 'p' may leak information from {x (interprocedural.c:7), y (interprocedural.c:8)}. Path: p (interprocedural.c:104) --> overwrite_after_leak(...) (interprocedural.c:96) --> p (interprocedural.c:97) |
66
| multilayer.c:16:10:16:10 | s | 's' may leak information from {b (multilayer.c:12)}. Path: s (multilayer.c:16) --> & ... (multilayer.c:18) |
77
| multilayer.c:29:10:29:10 | s | 's' may leak information from {b (multilayer.c:12), x (multilayer.c:7)}. Path: s (multilayer.c:29) --> & ... (multilayer.c:30) |
8-
| multilayer.c:34:8:34:8 | s | 's' may leak information from {struct <unnamed> (multilayer.c:6)}. Path: s (multilayer.c:34) --> & ... (multilayer.c:35) |
8+
| multilayer.c:34:8:34:8 | s | 's' may leak information from {(unnamed class/struct/union) (multilayer.c:6)}. Path: s (multilayer.c:34) --> & ... (multilayer.c:35) |
99
| test.c:12:12:12:12 | s | 's' may leak information from {y (test.c:8)}. Path: s (test.c:12) --> & ... (test.c:14) |
1010
| test.c:18:12:18:12 | s | 's' may leak information from {x (test.c:7)}. Path: s (test.c:18) --> & ... (test.c:20) |
1111
| test.c:24:12:24:12 | s | 's' may leak information from {x (test.c:7), y (test.c:8)}. Path: s (test.c:24) --> & ... (test.c:25) |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
| test.c:4:8:4:8 | A | Type declaration A is not used. |
22
| test.c:7:18:7:18 | D | Type declaration D is not used. |
33
| test.c:28:11:28:11 | R | Type declaration R is not used. |
4-
| test.c:41:12:41:12 | struct <unnamed> | Type declaration struct <unnamed> is not used. |
4+
| test.c:41:12:41:12 | (unnamed class/struct/union) | Type declaration (unnamed class/struct/union) is not used. |

c/common/test/rules/useinitializerbracestomatchaggregatetypestructure/UseInitializerBracesToMatchAggregateTypeStructure.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
| test.c:35:32:35:35 | {...} | Missing braces on aggregate literal of type int[2]$@ which is assigned to index 2 in $@. | file://:0:0:0:0 | int[2] | int[2] | test.c:35:18:35:42 | {...} | array of type int[4][2] |
44
| test.c:35:38:35:41 | {...} | Missing braces on aggregate literal of type int[2]$@ which is assigned to index 3 in $@. | file://:0:0:0:0 | int[2] | int[2] | test.c:35:18:35:42 | {...} | array of type int[4][2] |
55
| test.c:41:34:41:34 | {...} | Missing braces on aggregate literal of type int[2]$@ which is assigned to index 1 in $@. | file://:0:0:0:0 | int[2] | int[2] | test.c:41:18:41:35 | {...} | array of type int[2][2] |
6-
| test.c:47:26:47:29 | {...} | Missing braces on aggregate literal of type $@ which is assigned to field $@. | test.c:4:10:4:10 | struct <unnamed> | struct <unnamed> | test.c:7:5:7:8 | m_s1 | m_s1 |
7-
| test.c:47:26:47:29 | {...} | Missing braces on aggregate literal of type $@ which is assigned to field $@. | test.c:11:10:11:10 | struct <unnamed> | struct <unnamed> | test.c:7:5:7:8 | m_s1 | m_s1 |
6+
| test.c:47:26:47:29 | {...} | Missing braces on aggregate literal of type $@ which is assigned to field $@. | test.c:4:10:4:10 | (unnamed class/struct/union) | (unnamed class/struct/union) | test.c:7:5:7:8 | m_s1 | m_s1 |
7+
| test.c:47:26:47:29 | {...} | Missing braces on aggregate literal of type $@ which is assigned to field $@. | test.c:11:10:11:10 | (unnamed class/struct/union) | (unnamed class/struct/union) | test.c:7:5:7:8 | m_s1 | m_s1 |

c/misra/src/codingstandards/c/misra/EssentialTypes.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,12 @@ predicate isAssignmentToEssentialType(Type lValueEssentialType, Expr rValue) {
404404
// Initializing an array
405405
exists(ArrayAggregateLiteral aal |
406406
lValueEssentialType = aal.getElementType() and
407-
rValue = aal.getElementExpr(_)
407+
rValue = aal.getAnElementExpr(_)
408408
)
409409
or
410410
// Initializing a struct or union
411411
exists(ClassAggregateLiteral cal, Field field |
412412
lValueEssentialType = field.getType() and
413-
rValue = cal.getFieldExpr(field)
413+
rValue = cal.getAFieldExpr(field)
414414
)
415415
}

c/misra/src/rules/RULE-13-1/InitializerListsContainPersistentSideEffects.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ from AggregateLiteral initList, SideEffect effect
2525
where
2626
not isExcluded(initList, SideEffects1Package::initializerListsContainPersistentSideEffectsQuery()) and
2727
(
28-
initList.(ArrayOrVectorAggregateLiteral).getElementExpr(_) = effect
28+
initList.(ArrayOrVectorAggregateLiteral).getAnElementExpr(_) = effect
2929
or
30-
initList.(ClassAggregateLiteral).getFieldExpr(_) = effect
30+
initList.(ClassAggregateLiteral).getAFieldExpr(_) = effect
3131
)
3232
select initList, "Initializer list constains persistent $@", effect, "side effect"

c/misra/src/rules/RULE-2-4/UnusedTagDeclaration.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ from UserType s
2020
where
2121
not isExcluded(s, DeadCodePackage::unusedTagDeclarationQuery()) and
2222
// ignore structs without a tag name
23-
not s.getName() = "struct <unnamed>" and
23+
not s.isAnonymous() and
2424
// typedefs do not have a "tag" name, so this rule does not apply to them
2525
not s instanceof TypedefType and
2626
// Not mentioned anywhere

c/misra/src/rules/RULE-21-14/MemcmpUsedToCompareNullTerminatedStrings.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class NullTerminatedStringToMemcmpConfiguration extends TaintTracking::Configura
3030
// The array element type is an essentially character type
3131
getEssentialTypeCategory(aal.getElementType()) = EssentiallyCharacterType() and
3232
// Includes a null terminator somewhere in the array initializer
33-
aal.getElementExpr(_).getValue().toInt() = 0
33+
aal.getAnElementExpr(_).getValue().toInt() = 0
3434
|
3535
// For local variables, use the array aggregate literal as the source
3636
aal = source.asExpr()

c/misra/src/rules/RULE-5-7/TagNameNotUnique.ql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ where
2222
not isExcluded(s2, Declarations3Package::tagNameNotUniqueQuery()) and
2323
not s = s2 and
2424
s.getName() = s2.getName() and
25-
not s.getName() = "struct <unnamed>" and
26-
not s.getName() = "union <unnamed>" and
25+
not s.isAnonymous() and
2726
not s.getName() = s2.(TypedefType).getBaseType().toString()
2827
select s, "Tag name is nonunique compared to $@.", s2, s2.getName()

c/misra/src/rules/RULE-9-4/RepeatedInitializationOfAggregateObjectElement.ql

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ string getNestedArrayIndexString(Expr e) {
3838
any(int elementIndex |
3939
exists(ArrayAggregateLiteral parent |
4040
parent = getNthParent(e, pragma[only_bind_into](depth + 1)) and
41-
parent.getElementExpr(elementIndex) = getNthParent(e, pragma[only_bind_into](depth))
41+
parent.getAnElementExpr(elementIndex) = getNthParent(e, pragma[only_bind_into](depth))
4242
)
4343
|
4444
elementIndex
@@ -54,9 +54,9 @@ string getNestedArrayIndexString(Expr e) {
5454
*/
5555
language[monotonicAggregates]
5656
int getMaxDepth(ArrayAggregateLiteral al) {
57-
if not exists(al.getElementExpr(_).(ArrayAggregateLiteral))
57+
if not exists(al.getAnElementExpr(_).(ArrayAggregateLiteral))
5858
then result = 0
59-
else result = 1 + max(Expr child | child = al.getElementExpr(_) | getMaxDepth(child))
59+
else result = 1 + max(Expr child | child = al.getAnElementExpr(_) | getMaxDepth(child))
6060
}
6161

6262
// internal recursive predicate for `hasMultipleInitializerExprsForSameIndex`
@@ -66,8 +66,8 @@ predicate hasMultipleInitializerExprsForSameIndexInternal(
6666
exists(int shared_index, Expr al1_expr, Expr al2_expr |
6767
// an `Expr` initializing an element of the same index in both `al1` and `al2`
6868
shared_index = [0 .. al1.getArraySize() - 1] and
69-
al1_expr = al1.getElementExpr(shared_index) and
70-
al2_expr = al2.getElementExpr(shared_index) and
69+
al1_expr = al1.getAnElementExpr(shared_index) and
70+
al2_expr = al2.getAnElementExpr(shared_index) and
7171
// but not the same `Expr`
7272
not al1_expr = al2_expr and
7373
(
@@ -98,7 +98,7 @@ predicate hasMultipleInitializerExprsForSameIndex(ArrayAggregateLiteral root, Ex
9898
* This predicate is therefore unable to distinguish the individual duplicate expressions.
9999
*/
100100
predicate hasMultipleInitializerExprsForSameField(ClassAggregateLiteral root, Field f) {
101-
count(root.getFieldExpr(f)) > 1
101+
count(root.getAFieldExpr(f)) > 1
102102
}
103103

104104
from
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| test.c:2:9:2:9 | union <unnamed> | Use of banned 'union' keyword. |
1+
| test.c:2:9:2:9 | (unnamed class/struct/union) | Use of banned 'union' keyword. |

cpp/autosar/src/rules/A12-1-5/InitializerHashCons.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ private predicate mk_FieldCons(
891891
analyzableClassAggregateLiteral(cal) and
892892
cal.getUnspecifiedType() = c and
893893
exists(Expr e |
894-
e = cal.getFieldExpr(f).getFullyConverted() and
894+
e = cal.getAFieldExpr(f).getFullyConverted() and
895895
f.getInitializationOrder() = i and
896896
(
897897
hc = hashCons(e) and
@@ -907,9 +907,9 @@ private predicate mk_FieldCons(
907907
private predicate analyzableClassAggregateLiteral(ClassAggregateLiteral cal) {
908908
forall(int i | exists(cal.getChild(i)) |
909909
strictcount(cal.getChild(i).getFullyConverted()) = 1 and
910-
strictcount(Field f | cal.getChild(i) = cal.getFieldExpr(f)) = 1 and
910+
strictcount(Field f | cal.getChild(i) = cal.getAFieldExpr(f)) = 1 and
911911
strictcount(Field f, int j |
912-
cal.getFieldExpr(f) = cal.getChild(i) and j = f.getInitializationOrder()
912+
cal.getAFieldExpr(f) = cal.getChild(i) and j = f.getInitializationOrder()
913913
) = 1
914914
)
915915
}

cpp/autosar/src/rules/A5-1-1/LiteralValueUsedOutsideTypeInit.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ where
4949
// Macro expansions are morally excluded
5050
not l = any(MacroInvocation mi).getAnExpandedElement() and
5151
// Aggregate literal
52-
not l = any(ArrayOrVectorAggregateLiteral aal).getElementExpr(_).getAChild*() and
52+
not l = any(ArrayOrVectorAggregateLiteral aal).getAnElementExpr(_).getAChild*() and
5353
// Ignore x - 1 expressions
5454
not exists(SubExpr se | se.getRightOperand() = l and l.getValue() = "1")
5555
select l,

cpp/autosar/src/rules/A5-1-9/LambdaEquivalence.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ private module HashCons {
989989
analyzableClassAggregateLiteral(cal) and
990990
cal.getUnspecifiedType() = c and
991991
exists(Expr e |
992-
e = cal.getFieldExpr(f).getFullyConverted() and
992+
e = cal.getAFieldExpr(f).getFullyConverted() and
993993
f.getInitializationOrder() = i and
994994
(
995995
hc = hashConsExpr(e) and
@@ -1005,9 +1005,9 @@ private module HashCons {
10051005
private predicate analyzableClassAggregateLiteral(ClassAggregateLiteral cal) {
10061006
forall(int i | exists(cal.getChild(i)) |
10071007
strictcount(cal.getChild(i).getFullyConverted()) = 1 and
1008-
strictcount(Field f | cal.getChild(i) = cal.getFieldExpr(f)) = 1 and
1008+
strictcount(Field f | cal.getChild(i) = cal.getAFieldExpr(f)) = 1 and
10091009
strictcount(Field f, int j |
1010-
cal.getFieldExpr(f) = cal.getChild(i) and j = f.getInitializationOrder()
1010+
cal.getAFieldExpr(f) = cal.getChild(i) and j = f.getInitializationOrder()
10111011
) = 1
10121012
)
10131013
}

cpp/autosar/src/rules/A8-4-9/InOutParametersDeclaredAsTNotModified.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ where
6060
//also not having a nonconst member accessed through the param
6161
notUsedAsQualifierForNonConst(p) and
6262
not exists(ClassAggregateLiteral l, Field f |
63-
DataFlow::localExprFlow(p.getAnAccess(), l.getFieldExpr(f)) and
63+
DataFlow::localExprFlow(p.getAnAccess(), l.getAFieldExpr(f)) and
6464
not f.isConst()
6565
) and
6666
// Exclude parameters that are used to initialize member fields.

cpp/autosar/src/rules/M8-0-1/MultipleGlobalOrMemberDeclarators.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class NonLocalUserDeclaration extends Declaration {
4646
not this.(Parameter).getFunction().isCompilerGenerated() and
4747
not this.isInMacroExpansion() and
4848
not exists(Struct s, TypedefType t |
49-
s.getName() = "struct <unnamed>" and
49+
s.isAnonymous() and
5050
t.getBaseType() = s and
5151
this = s.getAMemberVariable()
5252
)

cpp/common/src/codingstandards/cpp/StructuralEquivalence.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ private module HashCons {
989989
analyzableClassAggregateLiteral(cal) and
990990
cal.getUnspecifiedType() = c and
991991
exists(Expr e |
992-
e = cal.getFieldExpr(f).getFullyConverted() and
992+
e = cal.getAFieldExpr(f).getFullyConverted() and
993993
f.getInitializationOrder() = i and
994994
(
995995
hc = hashConsExpr(e) and
@@ -1005,9 +1005,9 @@ private module HashCons {
10051005
private predicate analyzableClassAggregateLiteral(ClassAggregateLiteral cal) {
10061006
forall(int i | exists(cal.getChild(i)) |
10071007
strictcount(cal.getChild(i).getFullyConverted()) = 1 and
1008-
strictcount(Field f | cal.getChild(i) = cal.getFieldExpr(f)) = 1 and
1008+
strictcount(Field f | cal.getChild(i) = cal.getAFieldExpr(f)) = 1 and
10091009
strictcount(Field f, int j |
1010-
cal.getFieldExpr(f) = cal.getChild(i) and j = f.getInitializationOrder()
1010+
cal.getAFieldExpr(f) = cal.getChild(i) and j = f.getInitializationOrder()
10111011
) = 1
10121012
)
10131013
}

cpp/common/src/codingstandards/cpp/enhancements/AggregateLiteralEnhancements.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ module ClassAggregateLiterals {
114114
exists(Expr compilerGeneratedVal, int index, Expr previousExpr |
115115
// Identify the candidate expression which may be compiler generated
116116
compilerGeneratedVal = cal.getChild(index) and
117-
compilerGeneratedVal = cal.getFieldExpr(f) and
117+
compilerGeneratedVal = cal.getAFieldExpr(f) and
118118
// Find the previous expression for this aggregate literal
119119
previousExpr = getPreviousExpr(cal, index)
120120
|
@@ -201,7 +201,7 @@ class InferredAggregateLiteral extends AggregateLiteral {
201201
predicate isExprValueInitialized(AggregateLiteral al, Expr e) {
202202
// This expression is a value initialized field
203203
exists(Field f |
204-
e = al.(ClassAggregateLiteral).getFieldExpr(f) and
204+
e = al.(ClassAggregateLiteral).getAFieldExpr(f) and
205205
ClassAggregateLiterals::isValueInitialized(al, f)
206206
)
207207
or
@@ -236,7 +236,7 @@ predicate isLeadingZeroInitialized(AggregateLiteral a) {
236236
// Or because it's a class aggregate, and all other fields are value initialized
237237
forall(Field f |
238238
f = a.getType().(Class).getAField() and
239-
not a.(ClassAggregateLiteral).getFieldExpr(f) = a.getChild(0)
239+
not a.(ClassAggregateLiteral).getAFieldExpr(f) = a.getChild(0)
240240
|
241241
ClassAggregateLiterals::isValueInitialized(a, f)
242242
)

cpp/common/src/codingstandards/cpp/rules/useinitializerbracestomatchaggregatetypestructure/UseInitializerBracesToMatchAggregateTypeStructure.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ query predicate problems(
2828
exists(string parentDescription |
2929
// For class aggergate literal parents, report which field is being assigned to
3030
exists(ClassAggregateLiteral cal, Field field |
31-
cal.getFieldExpr(field) = inferredAggregateLiteral and
31+
cal.getAFieldExpr(field) = inferredAggregateLiteral and
3232
parentDescription = "to field $@" and
3333
explanationElement = field
3434
|
@@ -37,15 +37,15 @@ query predicate problems(
3737
or
3838
// For array aggregate literal parents, report which index is being assigned to
3939
exists(ArrayAggregateLiteral aal, int elementIndex |
40-
aal.getElementExpr(elementIndex) = inferredAggregateLiteral and
40+
aal.getAnElementExpr(elementIndex) = inferredAggregateLiteral and
4141
parentDescription = "to index " + elementIndex + " in $@" and
4242
explanationElement = aal and
4343
explanationDescription = "array of type " + aal.getType().getName()
4444
)
4545
or
4646
// In some cases, we seem to have missing link, so provide a basic message
47-
not any(ArrayAggregateLiteral aal).getElementExpr(_) = inferredAggregateLiteral and
48-
not any(ClassAggregateLiteral aal).getFieldExpr(_) = inferredAggregateLiteral and
47+
not any(ArrayAggregateLiteral aal).getAnElementExpr(_) = inferredAggregateLiteral and
48+
not any(ClassAggregateLiteral aal).getAFieldExpr(_) = inferredAggregateLiteral and
4949
parentDescription = "to an unnamed field of $@" and
5050
explanationElement = inferredAggregateLiteral.getParent() and
5151
explanationDescription = " " + explanationElement.(Expr).getType().getName()

cpp/common/test/rules/unusedtypedeclarations/UnusedTypeDeclarations.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
| test.cpp:6:7:6:7 | B | Type declaration B is not used. |
33
| test.cpp:13:11:13:11 | D | Type declaration D is not used. |
44
| test.cpp:77:11:77:11 | R | Type declaration R is not used. |
5-
| test.cpp:90:12:90:12 | struct <unnamed> | Type declaration struct <unnamed> is not used. |
5+
| test.cpp:90:12:90:12 | (unnamed class/struct/union) | Type declaration (unnamed class/struct/union) is not used. |
66
| test.cpp:111:29:111:30 | AA | Type declaration AA is not used. |

cpp/common/test/rules/useinitializerbracestomatchaggregatetypestructure/UseInitializerBracesToMatchAggregateTypeStructure.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
| test.cpp:41:22:41:25 | {...} | Missing braces on aggregate literal of type int[2]$@ which is assigned to index 1 in $@. | file://:0:0:0:0 | int[2] | int[2] | test.cpp:41:16:41:38 | {...} | array of type int[4][2] |
33
| test.cpp:41:28:41:31 | {...} | Missing braces on aggregate literal of type int[2]$@ which is assigned to index 2 in $@. | file://:0:0:0:0 | int[2] | int[2] | test.cpp:41:16:41:38 | {...} | array of type int[4][2] |
44
| test.cpp:41:34:41:37 | {...} | Missing braces on aggregate literal of type int[2]$@ which is assigned to index 3 in $@. | file://:0:0:0:0 | int[2] | int[2] | test.cpp:41:16:41:38 | {...} | array of type int[4][2] |
5-
| test.cpp:48:15:48:18 | {...} | Missing braces on aggregate literal of type $@ which is assigned to field $@. | test.cpp:6:10:6:10 | struct <unnamed> | struct <unnamed> | test.cpp:9:5:9:8 | m_s1 | m_s1 |
5+
| test.cpp:48:15:48:18 | {...} | Missing braces on aggregate literal of type $@ which is assigned to field $@. | test.cpp:6:10:6:10 | (unnamed class/struct/union) | (unnamed class/struct/union) | test.cpp:9:5:9:8 | m_s1 | m_s1 |

0 commit comments

Comments
 (0)