Skip to content

A7-3-1: HiddenInheritedNonOverridableMemberFunction reports false positives #360

Closed
@anthony-williams-woven

Description

@anthony-williams-woven

Affected rules

  • A7-3-1/HiddenInheritedNonOverridableMemberFunction

Description

A7-3-1 reports violations on operator= in derived classes. For assignment of a derived class to do anything meaningful, it must provide an operator=, and cannot rely on the base class definition. Any report of a violation on operator= is thus a false positive.

Example

class base_class {};

class derived : private base_class {
 public:
  derived& operator=(const derived&) noexcept = default;
};

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