C++: Fix NameQualifyingElement db inconsistency#21968
Open
jketema wants to merge 3 commits into
Open
Conversation
While where the remove the file restriction in QL.
NameQualifyingElement db inconsistency
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the C++ database schema and QL library so that @derivedtype can act as a NameQualifyingElement, addressing a database inconsistency observed for certain name-qualification patterns.
Changes:
- Extend the dbscheme
@namequalifyingelementunion to include@derivedtype. - Update the C++ QL type model so
DerivedTypeparticipates in name-qualifier APIs. - Expand the name-qualifier library test corpus and expected results to cover the inconsistency cases.
Show a summary per file
| File | Description |
|---|---|
| cpp/ql/lib/semmlecode.cpp.dbscheme | Extends @namequalifyingelement to include @derivedtype. |
| cpp/ql/lib/semmle/code/cpp/Type.qll | Makes DerivedType a NameQualifyingElement in the QL model. |
| cpp/ql/lib/upgrades/ef8d209a22e27413aaaeff4446f0ecb9fa2c227b/* | Adds the upgrade pack for the schema change. |
| cpp/downgrades/0853f43dc8c08deecb473c54a2b70da8597f1ab5/* | Adds the downgrade pack for the schema change. |
| cpp/ql/test/library-tests/name_qualifiers/NameQualifiers1.ql | Broadens the query to include qualifiers from all files in the test DB. |
| cpp/ql/test/library-tests/name_qualifiers/NameQualifiers1.expected | Updates expected results to include the new inconsistency cases. |
| cpp/ql/test/library-tests/name_qualifiers/inconsistency.cpp | Adjusts the test input (incl. signature change) used to reproduce the inconsistency. |
| cpp/ql/test/library-tests/name_qualifiers/inconsistency2.cpp | Adds a new test case exercising qualification via derived types (e.g. const s::). |
Copilot's findings
- Files reviewed: 12/12 changed files
- Comments generated: 0
geoffw0
approved these changes
Jun 11, 2026
geoffw0
left a comment
Contributor
There was a problem hiding this comment.
Changes LGTM.
I have asked a question on the DCA run.
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.
Commit-by-commit review recommended.