Skip to content

Commit 2029a18

Browse files
committed
Exclude methods part of uninstantiated templates from consideration
The partial information doesn't allow us to correctly identify if called functions are const.
1 parent e1f822a commit 2029a18

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cpp/autosar/src/rules/M9-3-3/MemberFunctionConstIfPossible.ql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ class ConstMemberFunctionCandidate extends NonConstMemberFunction {
5454
not this instanceof Destructor and
5555
not this instanceof Operator and
5656
//less interested in MemberFunctions with no definition
57-
this.hasDefinition()
57+
this.hasDefinition() and
58+
// For uninstantiated templates we have only partial information that prevents us from determining
59+
// if the candidate calls non-const functions. Therefore we exclude these.
60+
not this.isFromUninstantiatedTemplate(_)
5861
}
5962

6063
/**

0 commit comments

Comments
 (0)