Skip to content

Narrowly focused implementation of RULE 15-0-1#1121

Open
MichaelRFairhurst wants to merge 20 commits intomainfrom
michaelrfairhurst/classes-3-take-2-rule-15-0-1
Open

Narrowly focused implementation of RULE 15-0-1#1121
MichaelRFairhurst wants to merge 20 commits intomainfrom
michaelrfairhurst/classes-3-take-2-rule-15-0-1

Conversation

@MichaelRFairhurst
Copy link
Copy Markdown
Collaborator

@MichaelRFairhurst MichaelRFairhurst commented Apr 29, 2026

Description

please enter the description of your change here

Change request type

  • Release or process automation (GitHub workflows, internal scripts)
  • Internal documentation
  • External documentation
  • Query files (.ql, .qll, .qls or unit tests)
  • External scripts (analysis report or other code shipped as part of a release)

Rules with added or modified queries

  • No rules added
  • Queries have been added for the following rules:
    • RULE-15-0-1
  • Queries have been modified for the following rules:
    • rule number here

Release change checklist

A change note (development_handbook.md#change-notes) is required for any pull request which modifies:

  • The structure or layout of the release artifacts.
  • The evaluation performance (memory, execution time) of an existing query.
  • The results of an existing query in any circumstance.

If you are only adding new rule queries, a change note is not required.

Author: Is a change note required?

  • Yes
  • No

🚨🚨🚨
Reviewer: Confirm that format of shared queries (not the .qll file, the
.ql file that imports it) is valid by running them within VS Code.

  • Confirmed

Reviewer: Confirm that either a change note is not required or the change note is required and has been added.

  • Confirmed

Query development review checklist

For PRs that add new queries or modify existing queries, the following checklist should be completed by both the author and reviewer:

Author

  • Have all the relevant rule package description files been checked in?
  • Have you verified that the metadata properties of each new query is set appropriately?
  • Do all the unit tests contain both "COMPLIANT" and "NON_COMPLIANT" cases?
  • Are the alert messages properly formatted and consistent with the style guide?
  • Have you run the queries on OpenPilot and verified that the performance and results are acceptable?
    As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.
  • Does the query have an appropriate level of in-query comments/documentation?
  • Have you considered/identified possible edge cases?
  • Does the query not reinvent features in the standard library?
  • Can the query be simplified further (not golfed!)

Reviewer

  • Have all the relevant rule package description files been checked in?
  • Have you verified that the metadata properties of each new query is set appropriately?
  • Do all the unit tests contain both "COMPLIANT" and "NON_COMPLIANT" cases?
  • Are the alert messages properly formatted and consistent with the style guide?
  • Have you run the queries on OpenPilot and verified that the performance and results are acceptable?
    As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.
  • Does the query have an appropriate level of in-query comments/documentation?
  • Have you considered/identified possible edge cases?
  • Does the query not reinvent features in the standard library?
  • Can the query be simplified further (not golfed!)

@MichaelRFairhurst MichaelRFairhurst changed the title First round tests Narrowly focused implementation of RULE 15-0-1 Apr 29, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new MISRA C++:2023 RULE-15-0-1 implementation (plus an audit companion query) to detect incorrectly provided special member functions, including packaging/metadata wiring and a dedicated test suite.

Changes:

  • Introduces ImproperlyProvidedSpecialMemberFunctions.ql and ImproperlyProvidedSpecialMemberFunctionsAudit.ql for RULE-15-0-1.
  • Adds helper library logic (AnalyzableClass.qll) to model special-member availability/customization.
  • Registers the new rule package in exclusions/metadata and adds comprehensive .qlref/.expected/C++ test fixtures.
Show a summary per file
File Description
rule_packages/cpp/Classes3.json Adds RULE-15-0-1 rule package entries (main + audit).
cpp/misra/src/rules/RULE-15-0-1/ImproperlyProvidedSpecialMemberFunctions.ql Main RULE-15-0-1 query implementation and message logic.
cpp/misra/src/rules/RULE-15-0-1/ImproperlyProvidedSpecialMemberFunctionsAudit.ql Audit query for “not analyzable” classes.
cpp/misra/src/rules/RULE-15-0-1/AnalyzableClass.qll Shared modeling of special member functions for analyzable classes.
cpp/common/src/codingstandards/cpp/exclusions/cpp/RuleMetadata.qll Wires the new Classes3 package into query metadata/exclusions.
cpp/common/src/codingstandards/cpp/exclusions/cpp/Classes3.qll New autogenerated metadata module for the Classes3 package.
cpp/misra/test/rules/RULE-15-0-1/test.cpp New C++ test fixture covering compliant/non-compliant and audit cases.
cpp/misra/test/rules/RULE-15-0-1/*.qlref Test references to the production queries.
cpp/misra/test/rules/RULE-15-0-1/*.expected Expected results for both main and audit queries.

Copilot's findings

Comments suppressed due to low confidence (4)

cpp/misra/test/rules/RULE-15-0-1/test.cpp:376

  • The audit .expected file reports an alert at this class, but the test source does not mark it // NON_COMPLIANT (or similar). Please add the appropriate NON_COMPLIANT annotation here or remove/update the corresponding row in ImproperlyProvidedSpecialMemberFunctionsAudit.expected.
class UnmovableDerivedPublicVirtualDtor
    : public UnmovableBasePublicVirtualDtor {};

cpp/misra/test/rules/RULE-15-0-1/test.cpp:403

  • The audit .expected file reports an alert at this class, but the test source does not mark it // NON_COMPLIANT (or similar). Please add the appropriate NON_COMPLIANT annotation here or remove/update the corresponding row in ImproperlyProvidedSpecialMemberFunctionsAudit.expected.
class ProtectedDtorDerived : public BaseProtectedDtor {};

cpp/misra/test/rules/RULE-15-0-1/test.cpp:416

  • The audit .expected file reports an alert at this class, but the test source does not mark it // NON_COMPLIANT (or similar). Please add the appropriate NON_COMPLIANT annotation here or remove/update the corresponding row in ImproperlyProvidedSpecialMemberFunctionsAudit.expected.
class VirtualProtectedDtorDerived : public BaseVirtualProtectedDtor {};

cpp/misra/test/rules/RULE-15-0-1/test.cpp:390

  • The audit .expected file reports an alert at this class, but the test source does not mark it // NON_COMPLIANT (or similar). Please add the appropriate NON_COMPLIANT annotation here or remove/update the corresponding row in ImproperlyProvidedSpecialMemberFunctionsAudit.expected.
class UnmovablePrivateVirtualDtorDerived : public UnmovablePrivateVirtualDtor {
};
  • Files reviewed: 11/11 changed files
  • Comments generated: 9

Comment thread cpp/misra/src/rules/RULE-15-0-1/AnalyzableClass.qll Outdated
Comment thread cpp/misra/src/rules/RULE-15-0-1/AnalyzableClass.qll
Comment thread cpp/misra/test/rules/RULE-15-0-1/test.cpp
Comment thread cpp/misra/src/rules/RULE-15-0-1/AnalyzableClass.qll
Comment thread cpp/misra/test/rules/RULE-15-0-1/test.cpp
Comment thread cpp/misra/src/rules/RULE-15-0-1/ImproperlyProvidedSpecialMemberFunctionsAudit.ql Outdated
Comment thread rule_packages/cpp/Classes3.json
Comment thread cpp/misra/src/rules/RULE-15-0-1/AnalyzableClass.qll Outdated
Comment thread cpp/misra/test/rules/RULE-15-0-1/test.cpp Outdated
Comment thread cpp/misra/test/rules/RULE-15-0-1/test.cpp Outdated
@mbaluda mbaluda self-requested a review April 30, 2026 18:20
Comment thread cpp/misra/src/rules/RULE-15-0-1/AnalyzableClass.qll Outdated
Comment thread cpp/misra/src/rules/RULE-15-0-1/AnalyzableClass.qll
Comment thread cpp/misra/src/rules/RULE-15-0-1/ImproperlyProvidedSpecialMemberFunctions.ql Outdated
Comment thread cpp/misra/src/rules/RULE-15-0-1/ImproperlyProvidedSpecialMemberFunctions.ql Outdated
Comment thread cpp/misra/test/rules/RULE-15-0-1/test.cpp
Comment thread cpp/misra/test/rules/RULE-15-0-1/test.cpp
Copy link
Copy Markdown
Collaborator

@jeongsoolee09 jeongsoolee09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some thoughts, overall looks amazing!! Thank you so much for tackling this to an already great extent!

Copy link
Copy Markdown
Collaborator

@jeongsoolee09 jeongsoolee09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@jeongsoolee09 jeongsoolee09 enabled auto-merge May 5, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants