Repository navigation
Fix RULE-15-1-3 false positives for lambda conversion operators - #1207
Merged
Merged
Conversation
castler
marked this pull request as ready for review
October 8, 2026 12:00
The closure type of a captureless lambda has a compiler-generated conversion operator to a function pointer. It is implicit by definition and cannot be declared explicit, so reporting it is a false positive. Exclude conversion operators declared by a Closure and add regression tests for captureless, generic and capturing lambdas.
marcmo
pushed a commit
to esrlabs/score_communication
that referenced
this pull request
Oct 26, 2026
…clipse-score#1437) Marks six single-argument constructors `explicit` (reported by `cpp/misra/non-explicit-conversion-member`) and updates the tests that relied on implicit conversion. No functional change. Not addressed here (of the 93 open alerts): - 71 "Conversion operator shall be explicit" alerts are almost all lambda closure operators (false positives, fixed upstream in github/codeql-coding-standards#1207, shipping in 2.63.0). - Deliberately implicit by design and already annotated, better handled as deviations: `OffsetPtr(pointer)` and its converting copy ctor, `operator pointer()`, `SamplePtr`/`SampleAllocateePtr` converting move ctors and `SamplePtr(nullptr_t)`, `PolymorphicOffsetPtrAllocator` ctors, `CopyableAtomic::operator T()`. - `TransactionLogLocalView(TransactionLog&)` is left implicit because the code relies on the implicit conversion. Tested: `bazel build //score/...` and tests under lola, message_passing, mw/com pass.
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
The closure type of a captureless lambda has a compiler-generated conversion operator to a function pointer. It is implicit by definition and cannot be declared explicit, so reporting it is a false positive.
Exclude conversion operators declared by a Closure and add regression tests for captureless, generic and capturing lambdas.
Change request type
.ql,.qll,.qlsor unit tests)Rules with added or modified queries
Release 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.