Skip to content

A13-3-1: Only report functions with the same number of parameters #399

Closed
@lcartey

Description

@lcartey

Affected rules

  • A13-3-1

Description

The rule title for this rule states:

A function that contains “forwarding reference” as its argument shall not be overloaded.

With the rationale saying:

Overloading functions with “forwarding reference” argument may lead to developer’s confusion on which function will be called.

Although the rule title suggests overloads with different numbers of parameters should be prohibited, there is no confusion in this case, and therefore I believe it's safe to exclude them.

Example

class foo {
public:
  foo() {} // error here
  template<typename T>
  foo(T&&){}
};

Metadata

Metadata

Assignees

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

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions