C++: Remove deprecated code#21896
Conversation
| * 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. |
There was a problem hiding this comment.
These have been deprecated from before the open sourcing of the CodeQL query code.
| * 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 `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. |
| * 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. |
| * 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. |
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>
| import semmle.code.cpp.Type | ||
|
|
||
| /** For upgraded databases without mangled name info. */ | ||
| pragma[noinline] |
There was a problem hiding this comment.
We remove getTopLevelClassName because of now we used getTopLevelClassMangledName instead, right?
0c09af9#diff-da1a46f6acbda9646e98808208de381e92e7c88326cdd3685b2b6ff1d33ef45eR58
There was a problem hiding this comment.
There's no getTopLevelClassMangledName. The important part is that we use hasCompleteTwin and not oldHasCompleteTwin. Everything else is just removal of dead private predicates.
There was a problem hiding this comment.
Now I see that! Thanks for the clarification
No description provided.