C++: Fix named qualifier dataset check error with decltypes#20784
Merged
jketema merged 4 commits intogithub:mainfrom Nov 10, 2025
Merged
C++: Fix named qualifier dataset check error with decltypes#20784jketema merged 4 commits intogithub:mainfrom
jketema merged 4 commits intogithub:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue with decltype in C++ code by allowing decltype to act as a name qualifier in addition to being a type. The change addresses a problem where decltype couldn't be used in qualified name contexts (e.g., decltype(expr)::member).
Key changes:
- Updated the database schema to include
@decltypein the@namequalifyingelementunion - Made
Decltype,TypeofType, andIntrinsicTransformedTypeclasses extendNameQualifyingElement - Added
getName()implementations that return descriptive strings like"decltype(...)"instead ofnone() - Updated test expectations to reflect new parameter type signatures containing
decltype(...)
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| cpp/ql/lib/semmlecode.cpp.dbscheme | Added @decltype to @namequalifyingelement union to allow decltype as a name qualifier |
| cpp/ql/lib/semmle/code/cpp/Type.qll | Made Decltype extend NameQualifyingElement and added getName() implementation returning "decltype(...)" |
| cpp/ql/lib/semmle/code/cpp/Type.qll | Updated TypeofType and IntrinsicTransformedType to return descriptive names instead of none() |
| cpp/ql/lib/semmle/code/cpp/NameQualifiers.qll | Updated documentation to mention decltype as a valid name qualifying element |
| cpp/ql/test/library-tests/dataflow/taint-tests/test_mad-signatures.expected | Updated test expectations with new decltype(...) parameter type entries |
| cpp/ql/lib/upgrades/c16b29b27f71247023321cc0d0360998b318837c/upgrade.properties | Added upgrade metadata for the schema change |
| cpp/downgrades/2121ffec11fac265524955fee1775217364d4ca4/upgrade.properties | Added downgrade metadata for schema compatibility |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
IdrissRio
approved these changes
Nov 10, 2025
Contributor
IdrissRio
left a comment
There was a problem hiding this comment.
LGTM 👍
There’s a small typo in the first commit message. Please consider fixing it.
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.
No description provided.