Repository navigation
ruff_cpp_spo: keep callee resolution status and namespaces - #136
Conversation
Today a::f and b::f collapse to 'f', an unresolved lookup set 'g' is reported as a resolved call, and a call through a function pointer 'fp' is reported as a call to 'fp'. The test fails on all three. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
…er side)
`walk_free_functions` now splits a body's calls by how far libclang resolved
them:
- `calls`: resolved only. Methods stay class-qualified (`A::reset`); free
functions carry their enclosing scopes (`a::f`, the same key as
`CppFunction::qualified_name`; bare at global scope, so C manifests are
unchanged).
- `unresolved_calls`: unresolved lookup sets (`OverloadedDeclRef`) as
`LookupSet { name, candidates }`, candidates scope-qualified with their
signature (`g(int)`, `g(double)`). Never reported as a resolved call.
- `dynamic_calls`: calls through a pointer, parameter or field (count only;
the variable's name is not a callee).
Re-pinned: the out-of-line fixture's `free_helper` (the makerow.cpp shape) is
now an unresolved lookup set, not a resolved call.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 164edbde60
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ters are dynamic A constructor or destructor CallExpr references a Constructor/Destructor declaration; it now resolves like a method (A::A) instead of counting as a dynamic call. A call whose callee expression is another call to a function returning a function pointer (factory()(1)) is dynamic even though libclang reports the inner function as its reference; the inner call keeps its own edge. Both conditions are required, so an operator call or a constructor whose first child is a call stays resolved. Codex P2 x2 on #136. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
Summary
Producer-side fix from the Semantic Grammar Recovery map (operator decision S2, item B9).
A libclang fixture showed three hazards in
walk_free_functionsbefore this change:callsbeforeuse_ns["f"]a::fandb::fcollapsed to one calleeuse_broken["g"]via_ptr["fp"]fpThe calls of a body are now split by how far libclang resolved them:
calls: resolved calls only.A::reset).a::f), the same key asCppFunction::qualified_name.unresolved_calls: unresolved lookup sets (OverloadedDeclRef) asLookupSet { name, candidates }. Candidates are scope-qualified with their signature (g(int),g(double)), so overloads stay distinct.dynamic_calls: calls through a pointer, parameter or field. Only the count is kept.Re-pinned: the out-of-line fixture's
free_helper(the makerow.cppmake_baseline_splineshape) is now an unresolved lookup set with candidatefree_helper(int), not a resolved call. Overload resolution did not happen there.Test plan
The libclang fixture was committed red first.
With
--features libclang(LIBCLANG_PATH=/usr/lib/llvm-18/lib): 76/76 lib tests pass, and clippy--all-targets -D warningsis clean.Disable runs, each red:
The lookup-set disable first failed to apply after
cargo fmtreflowed the line. The anchor assertion caught it, and the run was repeated against the formatted text.Remaining
ns1::A::resetvsns2::A::reset). Fixing that changes method keys in banked manifests; the decision is open.mainbefore this change (large_enum_variantat lib.rs, andCppFunctionused in tests without the feature). It is unchanged here.Not to be merged automatically.
Generated by Claude Code