-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C++: Fix named qualifier dataset check error with decltypes #20784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
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 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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
There’s a small typo in the first commit message. Please consider fixing it.
No description provided.