Skip to content

Commit 8d89f17

Browse files
committed
M14-6-1: Clarify documention
1 parent ac27623 commit 8d89f17

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

cpp/autosar/src/rules/M14-6-1/NameInDependentBase.qll

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ TemplateClass getADependentBaseType(TemplateClass t) {
1919

2020
/**
2121
* Gets a function call in `TemplateClass` `t` where the target function name exists in a dependent
22-
* base type and the function does not call that function.
22+
* base type and the call is to a function that is not declared in the dependent base type.
2323
*/
2424
FunctionCall parentMemberFunctionCall(TemplateClass t) {
2525
exists(TemplateClass dependentBaseType, MemberFunction dependentTypeFunction, Function target |
2626
dependentBaseType = getADependentBaseType(t) and
27+
// The target of the call is not declared in the dependent base type
2728
not target.getDeclaringType() = dependentBaseType and
2829
dependentBaseType.getAMember() = dependentTypeFunction and
2930
target.getName() = dependentTypeFunction.getName() and
@@ -33,12 +34,13 @@ FunctionCall parentMemberFunctionCall(TemplateClass t) {
3334
}
3435

3536
/**
36-
* There is a `MemberFunction` in parent class with same name
37-
* as a `FunctionAccess` that exists in a child `MemberFunction`
37+
* Gets a function access in `TemplateClass` `t` where the target function name exists in a dependent
38+
* base type and the access is to a function declared outside the dependent base type.
3839
*/
3940
FunctionAccess parentMemberFunctionAccess(TemplateClass t) {
4041
exists(TemplateClass dependentBaseType, MemberFunction dependentTypeFunction, Function target |
4142
dependentBaseType = getADependentBaseType(t) and
43+
// The target of the access is not declared in the dependent base type
4244
not target.getDeclaringType() = dependentBaseType and
4345
dependentBaseType.getAMember() = dependentTypeFunction and
4446
target.getName() = dependentTypeFunction.getName() and
@@ -48,14 +50,15 @@ FunctionAccess parentMemberFunctionAccess(TemplateClass t) {
4850
}
4951

5052
/**
51-
* There is a `MemberVariable` in parent class with same name
52-
* as a `VariableAccess` that exists in a child `MemberFunction`
53+
* Gets a memmber access in `TemplateClass` `t` where the target member name exists in a dependent
54+
* base type and the access is to a variable declared outside the dependent base type.
5355
*/
5456
Access parentMemberAccess(TemplateClass t) {
5557
exists(
5658
TemplateClass dependentBaseType, MemberVariable dependentTypeMemberVariable, Variable target
5759
|
5860
dependentBaseType = getADependentBaseType(t) and
61+
// The target of the access is not declared in the dependent base type
5962
not target.getDeclaringType() = dependentBaseType and
6063
dependentBaseType.getAMemberVariable() = dependentTypeMemberVariable and
6164
target.getName() = dependentTypeMemberVariable.getName() and

0 commit comments

Comments
 (0)