@@ -18,7 +18,7 @@ import codingstandards.cpp.autosar
1818import codingstandards.cpp.TypeUses
1919import codingstandards.cpp.Operator
2020
21- predicate templateDefinitionMentionsTypeParameter ( Declaration d , TemplateParameter tp ) {
21+ predicate templateDefinitionMentionsTypeParameter ( Declaration d , TypeTemplateParameter tp ) {
2222 exists ( Type t |
2323 (
2424 // direct reference, e.g., fields.
@@ -50,36 +50,36 @@ predicate templateDefinitionMentionsTypeParameter(Declaration d, TemplateParamet
5050}
5151
5252/**
53- * The set of `TemplateParameter ` references within an `Enum`.
53+ * The set of `TypeTemplateParameter ` references within an `Enum`.
5454 */
55- TemplateParameter enumTemplateReferences ( Enum e ) {
55+ TypeTemplateParameter enumTemplateReferences ( Enum e ) {
5656 templateDefinitionMentionsTypeParameter ( e .getADeclaration ( ) , result )
5757 or
5858 result = e .getExplicitUnderlyingType ( )
5959}
6060
6161/**
62- * The set of `TemplateParameter ` references within an `Class`.
62+ * The set of `TypeTemplateParameter ` references within an `Class`.
6363 */
64- TemplateParameter classTemplateReferences ( Class c ) {
64+ TypeTemplateParameter classTemplateReferences ( Class c ) {
6565 templateDefinitionMentionsTypeParameter ( c .getAMember ( ) , result )
6666 or
6767 c .getADerivation ( ) .getBaseType ( ) = result
6868}
6969
7070/**
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`.
7272 */
73- TemplateParameter enumConstantTemplateReferences ( EnumConstant ec ) {
73+ TypeTemplateParameter enumConstantTemplateReferences ( EnumConstant ec ) {
7474 templateDefinitionMentionsTypeParameter ( ec .getDeclaringType ( ) , result )
7575}
7676
7777/**
78- * The set of all `TemplateParameter `s referenced by a `Function`.
78+ * The set of all `TypeTemplateParameter `s referenced by a `Function`.
7979 */
80- TemplateParameter functionTemplateReferences ( Function mf ) {
80+ TypeTemplateParameter functionTemplateReferences ( Function mf ) {
8181 // the type of the function
82- exists ( TemplateParameter tp |
82+ exists ( TypeTemplateParameter tp |
8383 result = tp and
8484 (
8585 mf .getType ( ) .refersTo ( result )
@@ -115,10 +115,10 @@ TemplateParameter functionTemplateReferences(Function mf) {
115115}
116116
117117/**
118- * The set of all `TemplateParameters ` available as arguments to the declaring
118+ * The set of all `TypeTemplateParameters ` available as arguments to the declaring
119119 * element of some `Declarations`.
120120 */
121- TemplateParameter templateParametersOfDeclaringTemplateClass ( Declaration d ) {
121+ TypeTemplateParameter templateParametersOfDeclaringTemplateClass ( Declaration d ) {
122122 result = d .getDeclaringType ( ) .getATemplateArgument ( )
123123}
124124
@@ -149,7 +149,7 @@ where
149149 not d instanceof UserNegationOperator and
150150 // for each declaration within a template class get the
151151 // template parameters of the declaring class
152- not exists ( TemplateParameter t |
152+ not exists ( TypeTemplateParameter t |
153153 t = templateParametersOfDeclaringTemplateClass ( d ) and
154154 // and require that the declaration depends on at least
155155 // one of those template parameters.
@@ -170,7 +170,7 @@ where
170170 ) and
171171 // Omit using alias (cf. https://github.com/github/codeql-coding-standards/issues/739)
172172 // Exclude Using alias which refer directly to a TypeParameter
173- not d .( UsingAliasTypedefType ) .getBaseType ( ) instanceof TemplateParameter
173+ not d .( UsingAliasTypedefType ) .getBaseType ( ) instanceof TypeTemplateParameter
174174select d ,
175175 "Member " + d .getName ( ) + " template class does not use any of template arguments of its $@." ,
176176 d .getDeclaringType ( ) , "declaring type"
0 commit comments