Skip to content

C++: Remove deprecated code#21896

Open
jketema wants to merge 3 commits into
github:mainfrom
jketema:jketema/deprecated
Open

C++: Remove deprecated code#21896
jketema wants to merge 3 commits into
github:mainfrom
jketema:jketema/deprecated

Conversation

@jketema
Copy link
Copy Markdown
Contributor

@jketema jketema commented May 26, 2026

No description provided.

@github-actions github-actions Bot added the C++ label May 26, 2026
@github github deleted a comment from Hamid054 May 26, 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.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These have been deprecated from before the open sourcing of the CodeQL query code.

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.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

See #17581

* 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.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

See #18320

* 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.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

See #1760 and #1905. Note that databases created with CodeQL versions before 1.23.0 are now 7 years or older.

* 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.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

See #3783

@jketema jketema marked this pull request as ready for review May 27, 2026 08:50
@jketema jketema requested a review from a team as a code owner May 27, 2026 08:50
Copilot AI review requested due to automatic review settings May 27, 2026 08:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 the semmle.code.cpp.Member module.
  • Removes deprecated module-level Options.qll predicates (overrideReturnsNull, returnsNull, exits, exprExits, alwaysCheckReturnValue, okToIgnoreReturnValue) and their fallback wiring in DefaultOptions.qll.
  • Drops the oldHasCompleteTwin/name-based class resolution path in ResolveClass.qll used for upgraded databases without mangled_name facts, 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

Comment thread cpp/ql/lib/change-notes/2026-05-27-deprecated-removal.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@IdrissRio IdrissRio left a comment

Choose a reason for hiding this comment

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

Small question:

import semmle.code.cpp.Type

/** For upgraded databases without mangled name info. */
pragma[noinline]
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.

We remove getTopLevelClassName because of now we used getTopLevelClassMangledName instead, right?
0c09af9#diff-da1a46f6acbda9646e98808208de381e92e7c88326cdd3685b2b6ff1d33ef45eR58

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants