Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`A8-4-9`: Some template functions report variables as not used when they are

Open
#401 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
devtools

Research direction

Start by locating the implementation and tests for rule A8-4-9, then inspect how the query handles the uninstantiated template in the provided C++ example. Use that example to reproduce the report if possible; done means read and written parameters in such templates are not incorrectly reported as unused while valid findings remain.

Written by the indexing model from the issue text.

Description

Difficulty-High false positive/false negative Impact-Low Standard-AUTOSAR user-report
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);
}
Dominant language
CodeQL
Stars
227
Forks
82
Avg merge
6d 7h
Merged PRs (30d)
9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/codeql-coding-standards

All issues in github/codeql-coding-standards

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.