github / codeql-coding-standards

This repository contains CodeQL queries and libraries which support various Coding Standards.
MIT License
129 stars 59 forks source link

`A12-1-1`: False positive on deleted constructors #720

Closed nbusser-sr closed 4 weeks ago

nbusser-sr commented 1 month ago

Affected rules

Rule A12-1-1 (required, implementation, automated) Constructors shall explicitly initialize all virtual base classes, all direct non-virtual base classes and all non-static data members.

Description

A12-1-1 triggers on deleted constructors of an inherited class.

Example

class BaseClass {};

class InheritedClass final : public BaseClass {
    public:
    InheritedClass() = delete; // A12-1-1 warning

    InheritedClass(const InheritedClass&) = delete; // A12-1-1 warning

    InheritedClass(InheritedClass&&) = delete; // A12-1-1 warning
};
}