Skip to content

Commit

Permalink
Ignore deleted constructors when considering whether a base class is …
Browse files Browse the repository at this point in the history
…initialized
  • Loading branch information
lcartey committed Oct 18, 2024
1 parent 2a805c0 commit bc2aac3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions change_notes/2024-10-18-init-base-class-deleted.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- `A12-1-1`, `RULE-15-1-2` - `InitializeAllVirtualBaseClasses.ql`, `ExplicitConstructorBaseClassInitialization.ql`:
- Remove false positives for deleted member functions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ query predicate problems(
not c.isCompilerGenerated() and
// Not a defaulted constructor
not c.isDefaulted() and
// Not a deleted constructor
not c.isDeleted() and
declaringType_string = declaringType.getSimpleName() and
baseClass_string = baseClass.getSimpleName() and
message =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,13 @@ class Derived6 : public Base2 {

private:
Base2 b;
};

class Base3 {};

class Derived7 final : public Base3 {
public:
Derived7() = delete; // COMPLIANT
Derived7(const Derived7 &) = delete; // COMPLIANT
Derived7(Derived7 &&) = delete; // COMPLIANT
};

0 comments on commit bc2aac3

Please sign in to comment.