Skip to content

A7-1-7: Avoid reporting the same expression or declaration in multiple template instantiations #383

Closed
@lcartey

Description

@lcartey

Affected rules

  • A7-1-7

Description

In a template class or template function we may report the same logical expression in multiple template instantiations.

Example

template <typename T>
class Foo {
  void bar(T t) { t; } // COMPLIANT - but erroneously reported
};

void test() {
  Foo<int> i;
  Foo<float> f;
  i.bar(1);
  f.bar(1.0f);
}

Metadata

Metadata

Labels

Difficulty-LowA false positive or false negative report which is expected to take <1 day 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

Closed (Duplicate)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions