C++: Remove deprecated code#21896
Open
jketema wants to merge 3 commits into
Open
Conversation
jketema
commented
May 27, 2026
Comment on lines
+4
to
+9
| * Removed the deprecated `overrideReturnsNull` predicate from `Options.qll`. Use `CustomOptions.overrideReturnsNull` instead. | ||
| * Removed the deprecated `returnsNull` predicate from `Options.qll`. Use `CustomOptions.returnsNull` instead. | ||
| * Removed the deprecated `exits` predicate from `Options.qll`. Use `CustomOptions.exist` instead. | ||
| * Removed the deprecated `exprExits` predicate from `Options.qll`. Use `CustomOptions.exprExits` instead. | ||
| * Removed the deprecated `alwaysCheckReturnValue` predicate from `Options.qll`. Use `CustomOptions.alwaysCheckReturnValue` instead. | ||
| * Removed the deprecated `okToIgnoreReturnValue` predicate from `Options.qll`. Use `CustomOptions.okToIgnoreReturnValue` instead. |
Contributor
Author
There was a problem hiding this comment.
These have been deprecated from before the open sourcing of the CodeQL query code.
jketema
commented
May 27, 2026
Comment on lines
+11
to
+13
| * Removed the deprecated `UnknownDefaultLocation` class. Use `UnknownLocation` instead. | ||
| * Removed the deprecated `UnknownExprLocation` class. Use `UnknownLocation` instead. | ||
| * Removed the deprecated `UnknownStmtLocation` class. Use `UnknownLocation` instead. |
jketema
commented
May 27, 2026
| * Removed the deprecated `UnknownDefaultLocation` class. Use `UnknownLocation` instead. | ||
| * Removed the deprecated `UnknownExprLocation` class. Use `UnknownLocation` instead. | ||
| * Removed the deprecated `UnknownStmtLocation` class. Use `UnknownLocation` instead. | ||
| * Removed the deprecated `TemplateParameter` class. Use `TypeTemplateParameter` instead. |
jketema
commented
May 27, 2026
| * Removed the deprecated `UnknownExprLocation` class. Use `UnknownLocation` instead. | ||
| * Removed the deprecated `UnknownStmtLocation` class. Use `UnknownLocation` instead. | ||
| * Removed the deprecated `TemplateParameter` class. Use `TypeTemplateParameter` instead. | ||
| * Support for class resolution across link targets has been removed for databases which were created with CodeQL versions before 1.23.0. |
Contributor
Author
jketema
commented
May 27, 2026
| * Removed the deprecated `exprExits` predicate from `Options.qll`. Use `CustomOptions.exprExits` instead. | ||
| * Removed the deprecated `alwaysCheckReturnValue` predicate from `Options.qll`. Use `CustomOptions.alwaysCheckReturnValue` instead. | ||
| * Removed the deprecated `okToIgnoreReturnValue` predicate from `Options.qll`. Use `CustomOptions.okToIgnoreReturnValue` instead. | ||
| * Removed the deprecated `semmle.code.cpp.Member`. Import `semmle.code.cpp.Element` and/or `semmle.code.cpp.Type` directly. |
Contributor
There was a problem hiding this comment.
Pull request overview
Removes a batch of long-deprecated C++ QL APIs and related compatibility shims, along with the legacy class-resolution fallback for very old databases.
Changes:
- Removes deprecated classes/aliases:
TemplateParameter,UnknownDefaultLocation/UnknownExprLocation/UnknownStmtLocation, and thesemmle.code.cpp.Membermodule. - Removes deprecated module-level
Options.qllpredicates (overrideReturnsNull,returnsNull,exits,exprExits,alwaysCheckReturnValue,okToIgnoreReturnValue) and their fallback wiring inDefaultOptions.qll. - Drops the
oldHasCompleteTwin/name-based class resolution path inResolveClass.qllused for upgraded databases withoutmangled_namefacts, and adds a breaking change note.
Show a summary per file
| File | Description |
|---|---|
| cpp/ql/lib/semmle/code/cpp/TemplateParameter.qll | Removes deprecated TemplateParameter alias. |
| cpp/ql/lib/semmle/code/cpp/Member.qll | Deletes deprecated re-export module. |
| cpp/ql/lib/semmle/code/cpp/Location.qll | Removes deprecated Unknown*Location subclasses. |
| cpp/ql/lib/semmle/code/cpp/internal/ResolveClass.qll | Drops legacy name-based class resolution fallback. |
| cpp/ql/lib/Options.qll | Removes deprecated module-level options predicates. |
| cpp/ql/lib/DefaultOptions.qll | Removes CustomOptions::... fallback disjuncts. |
| cpp/ql/lib/cpp.qll | Removes import of deleted Member module. |
| cpp/ql/lib/change-notes/2026-05-27-deprecated-removal.md | New breaking-change note documenting removals. |
Copilot's findings
- Files reviewed: 8/8 changed files
- Comments generated: 1
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
IdrissRio
reviewed
May 27, 2026
| import semmle.code.cpp.Type | ||
|
|
||
| /** For upgraded databases without mangled name info. */ | ||
| pragma[noinline] |
Contributor
There was a problem hiding this comment.
We remove getTopLevelClassName because of now we used getTopLevelClassMangledName instead, right?
0c09af9#diff-da1a46f6acbda9646e98808208de381e92e7c88326cdd3685b2b6ff1d33ef45eR58
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.