Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdc002cc

Browse files
committed
Update queries afterTemplateParameter deprecation
1 parent40d7800 commitdc002cc

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ where
3232
// `isInMacroExpansion` is broken for `UserType`s.
3333
nots.isInMacroExpansion()and
3434
// Exclude template parameters, in case this is run on C++ code.
35-
notsinstanceofTemplateParameter
35+
notsinstanceofTypeTemplateParameter
3636
selects,"struct "+s.getName()+" has an unused tag."

‎cpp/autosar/src/rules/A13-3-1/FunctionThatContainsForwardingReferenceAsItsArgumentOverloaded.ql‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import codingstandards.cpp.FunctionEquivalence
1818

1919
classCandidateextendsTemplateFunction{
2020
Candidate(){
21-
this.getAParameter().getType().(RValueReferenceType).getBaseType()instanceofTemplateParameter
21+
this.getAParameter().getType().(RValueReferenceType).getBaseType()instanceofTypeTemplateParameter
2222
}
2323
}
2424

‎cpp/autosar/src/rules/A14-5-2/NonTemplateMemberDefinedInTemplate.ql‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import codingstandards.cpp.autosar
1818
import codingstandards.cpp.TypeUses
1919
import codingstandards.cpp.Operator
2020

21-
predicatetemplateDefinitionMentionsTypeParameter(Declarationd,TemplateParametertp){
21+
predicatetemplateDefinitionMentionsTypeParameter(Declarationd,TypeTemplateParametertp){
2222
exists(Typet|
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-
TemplateParameterenumTemplateReferences(Enume){
55+
TypeTemplateParameterenumTemplateReferences(Enume){
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-
TemplateParameterclassTemplateReferences(Classc){
64+
TypeTemplateParameterclassTemplateReferences(Classc){
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-
TemplateParameterenumConstantTemplateReferences(EnumConstantec){
73+
TypeTemplateParameterenumConstantTemplateReferences(EnumConstantec){
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-
TemplateParameterfunctionTemplateReferences(Functionmf){
80+
TypeTemplateParameterfunctionTemplateReferences(Functionmf){
8181
// the type of the function
82-
exists(TemplateParametertp|
82+
exists(TypeTemplateParametertp|
8383
result=tpand
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-
TemplateParametertemplateParametersOfDeclaringTemplateClass(Declarationd){
121+
TypeTemplateParametertemplateParametersOfDeclaringTemplateClass(Declarationd){
122122
result=d.getDeclaringType().getATemplateArgument()
123123
}
124124

@@ -149,7 +149,7 @@ where
149149
notdinstanceofUserNegationOperatorand
150150
// for each declaration within a template class get the
151151
// template parameters of the declaring class
152-
notexists(TemplateParametert|
152+
notexists(TypeTemplateParametert|
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-
notd.(UsingAliasTypedefType).getBaseType()instanceofTemplateParameter
173+
notd.(UsingAliasTypedefType).getBaseType()instanceofTypeTemplateParameter
174174
selectd,
175175
"Member "+d.getName()+" template class does not use any of template arguments of its $@.",
176176
d.getDeclaringType(),"declaring type"

‎cpp/autosar/src/rules/A14-5-3/NonMemberGenericOperatorCondition.ql‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import codingstandards.cpp.autosar
1818
classNonMemberGenericOperatorextendsTemplateFunction{
1919
NonMemberGenericOperator(){
2020
thisinstanceofOperatorand
21-
exists(TemplateParametertp,TypepType|
21+
exists(TypeTemplateParametertp,TypepType|
2222
pType=getAParameter().getType().getUnspecifiedType()//Parameter Type
2323
|
2424
pType=tpor

‎cpp/autosar/src/rules/A7-1-7/IdentifierDeclarationAndInitializationNotOnSeparateLines.ql‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class UniqueLineStmt extends Locatable {
2323
exists(Declarationd|
2424
this=d.getADeclarationEntry()and
2525
notdinstanceofParameterand
26-
notdinstanceofTemplateParameterand
26+
notdinstanceofTypeTemplateParameterand
2727
// TODO - Needs to be enhanced to solve issues with
2828
// templated inner classes.
2929
notdinstanceofFunctionand

‎cpp/autosar/src/rules/M14-5-3/CopyAssignmentOperatorNotDeclared.ql‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ class TemplateAssignmentOperatorMember extends MemberFunction {
3434
}
3535

3636
/**
37-
* is a copyassigment operator candidate if it has only one param and form in [T, T&, const T&, volatile T&, const volatile T&]
37+
* is a copyassignment operator candidate if it has only one param and form in [T, T&, const T&, volatile T&, const volatile T&]
3838
*/
3939
predicatehasGenericCopyCompatibleParameter(){
40-
exists(TemplateParametertp,TypepType|
40+
exists(TypeTemplateParametertp,TypepType|
4141
pType=this.getAParameter().getType().getUnspecifiedType()and//Parameter Type
4242
(
4343
tp=pType//T

‎cpp/common/test/guideline_recategorizations/DisappliedQuery.ql‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ from UserType ut, string reason
1717
where
1818
isExcluded(ut, DeadCodePackage::unusedTypeDeclarationsQuery(),reason)and
1919
exists(ut.getFile())and
20-
notutinstanceofTemplateParameterand
20+
notutinstanceofTypeTemplateParameterand
2121
notutinstanceofProxyClassand
2222
notexists(getATypeUse(ut))and
2323
notut.isFromUninstantiatedTemplate(_)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp