Skip to content

C++: Fix NameQualifyingElement db inconsistency#21968

Merged
jketema merged 3 commits into
github:mainfrom
jketema:jketema/namequalifiers
Jun 11, 2026
Merged

C++: Fix NameQualifyingElement db inconsistency#21968
jketema merged 3 commits into
github:mainfrom
jketema:jketema/namequalifiers

Conversation

@jketema

@jketema jketema commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Commit-by-commit review recommended.

@github-actions github-actions Bot added the C++ label Jun 10, 2026
@jketema jketema added no-change-note-required This PR does not need a change note and removed C++ labels Jun 10, 2026
@jketema jketema changed the title C++: Fix NameQualifyingElement db inconsistency C++: Fix NameQualifyingElement db inconsistency Jun 10, 2026
@jketema jketema added the C++ label Jun 10, 2026
@jketema jketema marked this pull request as ready for review June 10, 2026 13:09
@jketema jketema requested a review from a team as a code owner June 10, 2026 13:09
Copilot AI review requested due to automatic review settings June 10, 2026 13:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 @namequalifyingelement union to include @derivedtype.
  • Update the C++ QL type model so DerivedType participates 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 geoffw0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes LGTM.

I have asked a question on the DCA run.

@jketema

jketema commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Answered the questions on the DCA run. Merging.

@jketema jketema merged commit 642259c into github:main Jun 11, 2026
25 checks passed
@jketema jketema deleted the jketema/namequalifiers branch June 11, 2026 13:11
@geoffw0

geoffw0 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C++ no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants