Skip to content

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

Open
@lcartey

Description

@lcartey

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty-HighA false positive or false negative report which is expected to take 1+ week effort to addressImpact-LowStandard-AUTOSARfalse positive/false negativeAn issue related to observed false positives or false negatives.user-reportIssue reported by an end user of CodeQL Coding Standards

    Type

    No type

    Projects

    Status

    Triaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions