@@ -18,7 +18,7 @@ import codingstandards.cpp.autosar
18
18
import codingstandards.cpp.TypeUses
19
19
import codingstandards.cpp.Operator
20
20
21
- predicate templateDefinitionMentionsTypeParameter ( Declaration d , TemplateParameter tp ) {
21
+ predicate templateDefinitionMentionsTypeParameter ( Declaration d , TypeTemplateParameter tp ) {
22
22
exists ( Type t |
23
23
(
24
24
// direct reference, e.g., fields.
@@ -50,36 +50,36 @@ predicate templateDefinitionMentionsTypeParameter(Declaration d, TemplateParamet
50
50
}
51
51
52
52
/**
53
- * The set of `TemplateParameter ` references within an `Enum`.
53
+ * The set of `TypeTemplateParameter ` references within an `Enum`.
54
54
*/
55
- TemplateParameter enumTemplateReferences ( Enum e ) {
55
+ TypeTemplateParameter enumTemplateReferences ( Enum e ) {
56
56
templateDefinitionMentionsTypeParameter ( e .getADeclaration ( ) , result )
57
57
or
58
58
result = e .getExplicitUnderlyingType ( )
59
59
}
60
60
61
61
/**
62
- * The set of `TemplateParameter ` references within an `Class`.
62
+ * The set of `TypeTemplateParameter ` references within an `Class`.
63
63
*/
64
- TemplateParameter classTemplateReferences ( Class c ) {
64
+ TypeTemplateParameter classTemplateReferences ( Class c ) {
65
65
templateDefinitionMentionsTypeParameter ( c .getAMember ( ) , result )
66
66
or
67
67
c .getADerivation ( ) .getBaseType ( ) = result
68
68
}
69
69
70
70
/**
71
- * The set of all of the `TemplateParameter `s referenced by a `EnumConstant`.
71
+ * The set of all of the `TypeTemplateParameter `s referenced by a `EnumConstant`.
72
72
*/
73
- TemplateParameter enumConstantTemplateReferences ( EnumConstant ec ) {
73
+ TypeTemplateParameter enumConstantTemplateReferences ( EnumConstant ec ) {
74
74
templateDefinitionMentionsTypeParameter ( ec .getDeclaringType ( ) , result )
75
75
}
76
76
77
77
/**
78
- * The set of all `TemplateParameter `s referenced by a `Function`.
78
+ * The set of all `TypeTemplateParameter `s referenced by a `Function`.
79
79
*/
80
- TemplateParameter functionTemplateReferences ( Function mf ) {
80
+ TypeTemplateParameter functionTemplateReferences ( Function mf ) {
81
81
// the type of the function
82
- exists ( TemplateParameter tp |
82
+ exists ( TypeTemplateParameter tp |
83
83
result = tp and
84
84
(
85
85
mf .getType ( ) .refersTo ( result )
@@ -115,10 +115,10 @@ TemplateParameter functionTemplateReferences(Function mf) {
115
115
}
116
116
117
117
/**
118
- * The set of all `TemplateParameters ` available as arguments to the declaring
118
+ * The set of all `TypeTemplateParameters ` available as arguments to the declaring
119
119
* element of some `Declarations`.
120
120
*/
121
- TemplateParameter templateParametersOfDeclaringTemplateClass ( Declaration d ) {
121
+ TypeTemplateParameter templateParametersOfDeclaringTemplateClass ( Declaration d ) {
122
122
result = d .getDeclaringType ( ) .getATemplateArgument ( )
123
123
}
124
124
@@ -149,7 +149,7 @@ where
149
149
not d instanceof UserNegationOperator and
150
150
// for each declaration within a template class get the
151
151
// template parameters of the declaring class
152
- not exists ( TemplateParameter t |
152
+ not exists ( TypeTemplateParameter t |
153
153
t = templateParametersOfDeclaringTemplateClass ( d ) and
154
154
// and require that the declaration depends on at least
155
155
// one of those template parameters.
@@ -170,7 +170,7 @@ where
170
170
) and
171
171
// Omit using alias (cf. https://github.com/github/codeql-coding-standards/issues/739)
172
172
// Exclude Using alias which refer directly to a TypeParameter
173
- not d .( UsingAliasTypedefType ) .getBaseType ( ) instanceof TemplateParameter
173
+ not d .( UsingAliasTypedefType ) .getBaseType ( ) instanceof TypeTemplateParameter
174
174
select d ,
175
175
"Member " + d .getName ( ) + " template class does not use any of template arguments of its $@." ,
176
176
d .getDeclaringType ( ) , "declaring type"
0 commit comments