Skip to content

C++: Add support for more builtin operations - #22832

Merged
jketema merged 8 commits into
github:mainfrom
jketema:jketema/builtin
Oct 16, 2026
Merged

jketema merged 8 commits into
github:mainfrom
jketema:jketema/builtin

Conversation

@jketema

@jketema jketema commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@jketema jketema added the depends on internal PR This PR should only be merged in sync with an internal Semmle PR label Oct 15, 2026
@jketema
jketema marked this pull request as ready for review October 16, 2026 06:21
@jketema
jketema requested a review from a team as a code owner October 16, 2026 06:21
Copilot AI max review requested due to automatic review settings October 16, 2026 06:21

Copilot AI left a comment

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.

🟡 Changes recommended

The new expression test query silently omits member-access expressions because it assumes zero-based child indices.

2 open findings
What changed in this PR

Extends CodeQL’s C++ expression models to support seven additional compiler builtins.

Changes:

  • Adds schema kinds and QL classes for type traits and spaceship-comparison builtins.
  • Adds fixtures and expression-result checks.
  • Provides schema migration support and a change note.
File Description
cpp/​ql/​test/​library-tests/​builtins/​type_traits/​gcc.cpp Tests structural-type detection.
cpp/​ql/​test/​library-tests/​builtins/​type_traits/​expr.expected Updates type-trait expectations.
cpp/​ql/​test/​library-tests/​builtins/​type_traits/​clang.cpp Tests virtual bases and implicit lifetimes.
cpp/​ql/​test/​library-tests/​builtins/​builtins/​spaceship.cpp Tests spaceship-related builtins.
cpp/​ql/​test/​library-tests/​builtins/​builtins/​expr.ql Checks expression children and values.
cpp/​ql/​test/​library-tests/​builtins/​builtins/​expr.expected Records expression expectations.
cpp/​ql/​test/​library-tests/​builtins/​builtins/​builtins.expected Adds builtin classification expectations.
cpp/​ql/​lib/​upgrades/​6aec212e408fad907b19368a3376a4d9837783d2/​upgrade.properties Declares upgrade compatibility.
cpp/​ql/​lib/​upgrades/​6aec212e408fad907b19368a3376a4d9837783d2/​old.dbscheme Preserves the previous schema.
cpp/​ql/​lib/​semmlecode.cpp.dbscheme Adds seven builtin expression kinds.
cpp/​ql/​lib/​semmle/​code/​cpp/​exprs/​BuiltInOperations.qll Exposes new builtin QL classes.
cpp/​ql/​lib/​change-notes/​2026-10-16-builtins.md Documents added support.
cpp/​downgrades/​293904928d857b61a44dc0ff34c89c9eccb8a90a/​upgrade.properties Configures partial downgrade behavior.
cpp/​downgrades/​293904928d857b61a44dc0ff34c89c9eccb8a90a/​semmlecode.cpp.dbscheme Defines the downgrade target schema.
cpp/​downgrades/​293904928d857b61a44dc0ff34c89c9eccb8a90a/​exprs.ql Maps unsupported kinds to error expressions.

🧠 Review effort: Max


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cpp/ql/test/library-tests/builtins/builtins/expr.ql Outdated
Comment thread cpp/ql/lib/change-notes/2026-10-16-builtins.md Outdated
jketema and others added 2 commits October 16, 2026 08:56
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@geoffw0 geoffw0 left a comment

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.

LGTM. 👍

@jketema
jketema merged commit 5858ca2 into github:main Oct 16, 2026
21 of 22 checks passed
@jketema
jketema deleted the jketema/builtin branch October 16, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C++ depends on internal PR This PR should only be merged in sync with an internal Semmle PR documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants