Michaelrfairhurst/toolchain3 rule 4-1-2, deprecated features#1063
Open
MichaelRFairhurst wants to merge 11 commits intomainfrom
Open
Michaelrfairhurst/toolchain3 rule 4-1-2, deprecated features#1063MichaelRFairhurst wants to merge 11 commits intomainfrom
MichaelRFairhurst wants to merge 11 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new MISRA C++:2023 RULE-4-1-2 rule package (Toolchain3) with multiple queries to detect usage of deprecated C++17 language/library features, along with unit tests and supporting CodeQL/test-stdlib stubs.
Changes:
- Update
rules.csvto assignRULE-4-1-2to theToolchain3package. - Add
Toolchain3rule package metadata and integrate it into the exclusions/metadata plumbing. - Add new
RULE-4-1-2queries plus a full set of.qlref/.expectedtests and supporting test-include stubs.
Reviewed changes
Copilot reviewed 59 out of 64 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| rules.csv | Moves RULE-4-1-2 to the new Toolchain3 package. |
| rule_packages/cpp/Toolchain3.json | Defines the Toolchain3 package contents (queries, metadata) for RULE-4-1-2. |
| cpp/misra/test/rules/RULE-4-1-2/test.cpp | Test cases (COMPLIANT/NON_COMPLIANT) for all new RULE-4-1-2 queries. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfUncaughtException.qlref | Test harness reference for UseOfUncaughtException.ql. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfUncaughtException.expected | Expected results for UseOfUncaughtException. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedUnaryOrBinaryNegate.qlref | Test harness reference for UseOfDeprecatedUnaryOrBinaryNegate.ql. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedUnaryOrBinaryNegate.expected | Expected results for UseOfDeprecatedUnaryOrBinaryNegate. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedTemporaryBuffers.qlref | Test harness reference for UseOfDeprecatedTemporaryBuffers.ql. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedTemporaryBuffers.expected | Expected results for UseOfDeprecatedTemporaryBuffers. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedStrStreamClass.qlref | Test harness reference for UseOfDeprecatedStrStreamClass.ql. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedStrStreamClass.expected | Expected results for UseOfDeprecatedStrStreamClass. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedStdIteratorBaseClass.qlref | Test harness reference for UseOfDeprecatedStdIteratorBaseClass.ql. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedStdIteratorBaseClass.expected | Expected results for UseOfDeprecatedStdIteratorBaseClass. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedStdAllocatorMember.qlref | Test harness reference for UseOfDeprecatedStdAllocatorMember.ql. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedStdAllocatorMember.expected | Expected results for UseOfDeprecatedStdAllocatorMember. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedSharedPtrUnique.qlref | Test harness reference for UseOfDeprecatedSharedPtrUnique.ql. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedSharedPtrUnique.expected | Expected results for UseOfDeprecatedSharedPtrUnique. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedRawStorageIterator.qlref | Test harness reference for UseOfDeprecatedRawStorageIterator.ql. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedRawStorageIterator.expected | Expected results for UseOfDeprecatedRawStorageIterator. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedIsLiteralTypeTraits.qlref | Test harness reference for UseOfDeprecatedIsLiteralTypeTraits.ql. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedIsLiteralTypeTraits.expected | Expected results for UseOfDeprecatedIsLiteralTypeTraits. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedFunctionBinderTypedefMemberAudit.qlref | Test harness reference for UseOfDeprecatedFunctionBinderTypedefMemberAudit.ql. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedFunctionBinderTypedefMemberAudit.expected | Expected results for UseOfDeprecatedFunctionBinderTypedefMemberAudit. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedCHeaders.qlref | Test harness reference for UseOfDeprecatedCHeaders.ql. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedCHeaders.expected | Expected results for UseOfDeprecatedCHeaders. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedAllocatorVoid.qlref | Test harness reference for UseOfDeprecatedAllocatorVoid.ql. |
| cpp/misra/test/rules/RULE-4-1-2/UseOfDeprecatedAllocatorVoid.expected | Expected results for UseOfDeprecatedAllocatorVoid. |
| cpp/misra/test/rules/RULE-4-1-2/RedeclarationOfStaticConstexprDataMemberAudit.qlref | Test harness reference for RedeclarationOfStaticConstexprDataMemberAudit.ql. |
| cpp/misra/test/rules/RULE-4-1-2/RedeclarationOfStaticConstexprDataMemberAudit.expected | Expected results for RedeclarationOfStaticConstexprDataMemberAudit. |
| cpp/misra/test/rules/RULE-4-1-2/NoexceptSpecifierThrowAudit.qlref | Test harness reference for NoexceptSpecifierThrowAudit.ql. |
| cpp/misra/test/rules/RULE-4-1-2/NoexceptSpecifierThrowAudit.expected | Expected results for NoexceptSpecifierThrowAudit. |
| cpp/misra/test/rules/RULE-4-1-2/ImplicitDeclarationOfCopyConstructorAudit.qlref | Test harness reference for ImplicitDeclarationOfCopyConstructorAudit.ql. |
| cpp/misra/test/rules/RULE-4-1-2/ImplicitDeclarationOfCopyConstructorAudit.expected | Expected results for ImplicitDeclarationOfCopyConstructorAudit. |
| cpp/misra/test/rules/RULE-4-1-2/ImplicitDeclarationOfCopyConstructor.qlref | Test harness reference for ImplicitDeclarationOfCopyConstructor.ql. |
| cpp/misra/test/rules/RULE-4-1-2/ImplicitDeclarationOfCopyConstructor.expected | Expected results for ImplicitDeclarationOfCopyConstructor. |
| cpp/misra/src/rules/RULE-4-1-2/UseOfUncaughtException.ql | New query detecting std::uncaught_exception() usage. |
| cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedUnaryOrBinaryNegate.ql | New query detecting std::unary_negate / std::binary_negate. |
| cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedTemporaryBuffers.ql | New query detecting get_temporary_buffer / return_temporary_buffer. |
| cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedStrStreamClass.ql | New query detecting deprecated strstream* types. |
| cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedStdIteratorBaseClass.ql | New query detecting inheritance from std::iterator. |
| cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedStdAllocatorMember.ql | New query detecting deprecated std::allocator members. |
| cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedSharedPtrUnique.ql | New query detecting std::shared_ptr::unique(). |
| cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedRawStorageIterator.ql | New query detecting std::raw_storage_iterator. |
| cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedIsLiteralTypeTraits.ql | New query detecting std::is_literal_type / _v usage and specializations. |
| cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedFunctionBinderTypedefMemberAudit.ql | New audit query detecting deprecated typedef members like result_type. |
| cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedCHeaders.ql | New query detecting deprecated C headers (<ccomplex>, etc.). |
| cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedAllocatorVoid.ql | New query detecting std::allocator<void> specialization. |
| cpp/misra/src/rules/RULE-4-1-2/RedeclarationOfStaticConstexprDataMemberAudit.ql | New audit query detecting deprecated redeclarations/definitions of static constexpr members. |
| cpp/misra/src/rules/RULE-4-1-2/NoexceptSpecifierThrowAudit.ql | New audit query detecting deprecated throw() exception specification form. |
| cpp/misra/src/rules/RULE-4-1-2/ImplicitDeclarationOfCopyConstructorAudit.ql | New audit query for possibly-deprecated implicit special members. |
| cpp/misra/src/rules/RULE-4-1-2/ImplicitDeclarationOfCopyConstructor.ql | New query for definitely-deprecated implicit special members. |
| cpp/common/test/includes/standard-library/type_traits.h | Extends test stdlib stubs for is_literal_type(_v) and is_trivially_copyable(_v). |
| cpp/common/test/includes/standard-library/strstream.h | Extends test stdlib stubs for strstream and adds iostream alias. |
| cpp/common/test/includes/standard-library/memory.h | Extends test stdlib stubs with deprecated allocator members, temp buffers, raw_storage_iterator, shared_ptr::unique. |
| cpp/common/test/includes/standard-library/functional.h | Extends test stdlib stubs with deprecated typedef members and deprecated types. |
| cpp/common/test/includes/standard-library/ctgmath | Test include stub for <ctgmath>. |
| cpp/common/test/includes/standard-library/cstdbool | Test include stub for <cstdbool>. |
| cpp/common/test/includes/standard-library/cstdalign | Test include stub for <cstdalign>. |
| cpp/common/test/includes/standard-library/complex | Test include stub for <complex>. |
| cpp/common/test/includes/standard-library/ccomplex | Test include stub for <ccomplex>. |
| cpp/common/src/codingstandards/cpp/types/ImplicitSpecialMemberFunctions.qll | Adds shared logic for detecting deprecated implicit copy ctor/assignment cases. |
| cpp/common/src/codingstandards/cpp/standardlibrary/Memory.qll | Adds DefaultAllocator helper class used by allocator queries. |
| cpp/common/src/codingstandards/cpp/exclusions/cpp/Toolchain3.qll | Adds autogenerated exclusions/metadata wiring for Toolchain3 queries. |
| cpp/common/src/codingstandards/cpp/exclusions/cpp/RuleMetadata.qll | Imports Toolchain3 and integrates it into the global query-metadata dispatch. |
Comments suppressed due to low confidence (1)
rule_packages/cpp/Toolchain3.json:55
- Same as above:
implementation_scopeis an array here, but existing package JSON uses an object. Please change to the standard object form to avoid schema/tooling issues.
cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedStrStreamClass.ql
Outdated
Show resolved
Hide resolved
cpp/misra/src/rules/RULE-4-1-2/ImplicitDeclarationOfCopyConstructor.ql
Outdated
Show resolved
Hide resolved
cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedStdAllocatorMember.ql
Outdated
Show resolved
Hide resolved
cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedStdAllocatorMember.ql
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
please enter the description of your change here
Change request type
.ql,.qll,.qlsor unit tests)Rules with added or modified queries
RULE-4-1-2Release change checklist
A change note (development_handbook.md#change-notes) is required for any pull request which modifies:
If you are only adding new rule queries, a change note is not required.
Author: Is a change note required?
🚨🚨🚨
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.
Reviewer: Confirm that either a change note is not required or the change note is required and has been added.
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
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.
Reviewer
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.