codeql-coding-standards
codeql-coding-standards copied to clipboard
`A8-4-9`: Some template functions report variables as not used when they are
Affected rules
-
A8-4-9
Description
We have user reports of this query reporting read and written parameters as "not used". We do not have a reproduction case, but I believe we could start be excluding results on the uninstantiated template, as that copy of the function is "incomplete".
Example
template <typename T>
constexpr void swap(T& lhs, T& rhs) {
auto temp = std::move(lhs);
lhs = std::move(rhs);
rhs = std::move(temp);
}