Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions change_notes/2024-06-18-fix-fp-616-M9-3-3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- `M9-3-3` - `MemberFunctionStaticIfPossible.ql`:
- Fixes #616. Exclude uninstantiated templates.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ class NonStaticMemberFunction extends MemberFunction {
not this instanceof Constructor and
not this instanceof Destructor and
not this instanceof Operator and
this.hasDefinition()
this.hasDefinition() and
not this.isFromUninstantiatedTemplate(_)
}
}

Expand Down
9 changes: 8 additions & 1 deletion cpp/autosar/test/rules/M9-3-3/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,11 @@ void fp_reported_in_381() {
Z4 z;
int i = z.front();
z.fill(i);
}
}

class ZZ {
public:
template <typename T>
void fp_616(const T &val) {
} // COMPLIANT - ignore uninstantiated templates for static also
};