Skip to content

A5-0-2: Conditions in uninstantiated templates raise false-positives #10

Closed
@nicolaswill

Description

@nicolaswill

Affected rules

  • M5-3-1
  • A5-0-2
    • cpp/autosar/non-boolean-if-condition
    • cpp/autosar/non-boolean-iteration-condition

Description

Iteration or if statements of type bool within uninstantiated templates have an unknown type and raise a false positive.

Example

template<T>
void foo(std::vector<T> & v) {
  for (typename std::vector<T>::iterator it{v.begin()}; it != v.end(); ++it) {
     (*it)++;
  }
}

Metadata

Metadata

Assignees

Labels

Difficulty-MediumA false positive or false negative report which is expected to take 1-5 days effort to addressImpact-Mediumfalse 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

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions