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

Appearance settings

Commit 5ce788f

Browse filesBrowse files
authored
Merge pull request #626 from knewbury01/knewbury01/fix-616
M9-3-3: exclude uninstantiated templates from static member function query
2 parents d7117e8 + 199ad0b commit 5ce788f
Copy full SHA for 5ce788f

File tree

Expand file treeCollapse file tree

3 files changed

+12
-2
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+12
-2
lines changed
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- `M9-3-3` - `MemberFunctionStaticIfPossible.ql`:
2+
- Fixes #616. Exclude uninstantiated templates.

‎cpp/autosar/src/rules/M9-3-3/MemberFunctionStaticIfPossible.ql

Copy file name to clipboardExpand all lines: cpp/autosar/src/rules/M9-3-3/MemberFunctionStaticIfPossible.ql
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ class NonStaticMemberFunction extends MemberFunction {
3131
not this instanceof Constructor and
3232
not this instanceof Destructor and
3333
not this instanceof Operator and
34-
this.hasDefinition()
34+
this.hasDefinition() and
35+
not this.isFromUninstantiatedTemplate(_)
3536
}
3637
}
3738

‎cpp/autosar/test/rules/M9-3-3/test.cpp

Copy file name to clipboardExpand all lines: cpp/autosar/test/rules/M9-3-3/test.cpp
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,4 +214,11 @@ void fp_reported_in_381() {
214214
Z4 z;
215215
int i = z.front();
216216
z.fill(i);
217-
}
217+
}
218+
219+
class ZZ {
220+
public:
221+
template <typename T>
222+
void fp_616(const T &val) {
223+
} // COMPLIANT - ignore uninstantiated templates for static also
224+
};

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.