callgraph: same-file C++ free-function overloads stop as ambiguous regardless of arguments

Open
#197 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
67/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp, rust
Domain
devtools

Research direction

Start by tracing how callchain resolves C++ free-function calls and compare that path with the member-call overload disambiguation mentioned in the issue. Use the reproducer and run callchain call_over --up 0 --down 3; done means it follows over(int) to over1_leaf and never follows over0_leaf.

Written by the indexing model from the issue text.

Description

Direct callgraph resolution for C++ free functions ignores call arity and argument types, so an unambiguous call to an overloaded free function stops at [ambiguous:] instead of following the matching overload.

Reproducer

void over0_leaf() {}
void over1_leaf() {}
void over() { over0_leaf(); }
void over(int x) { (void)x; over1_leaf(); }
void call_over() { over(1); }

Running callchain call_over --up 0 --down 3 stops at over as [ambiguous:] rather than resolving over(1) to over(int) (over1_leaf).

Expected behavior

call_over should resolve over(1) to over(int) and follow over1_leaf (while still never following over0_leaf), matching the arity/type overload disambiguation already done for member calls.

Dominant language
Rust
Stars
187
Forks
53
Avg merge
1d 9h
Merged PRs (30d)
79

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from facebookexperimental/semcode

All issues in facebookexperimental/semcode

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.