Skip to content

C++ out-of-line static method definitions are missing the outer namespace in qualifiedName, breaking caller resolution for ns::Class::Method(...) calls #1291

Description

@Cecil-Huang

Version
1.4.1 (re-indexed with codegraph index -f after upgrading from 0.9.9 — v1.3.0's namespace-qualified-call fix (mentioned in CHANGELOG.md, "namespace-qualified calls (ns::fn(...)) resolve to their definitions") does NOT cover this specific case)

Repro shape
// manifest_startup.h
namespace simulator {
class ManifestStartup {
public:
struct Input { /* ... / };
struct Output { /
... */ };
static Output Apply(const Input& input);
};
} // namespace simulator
// manifest_startup.cpp
namespace simulator {
ManifestStartup::Output ManifestStartup::Apply(const Input& input) {
// ...
}
} // namespace simulator
// main.cpp (different file)
const auto manifest_result = simulator::ManifestStartup::Apply({ ... });
Observed
codegraph query "ManifestStartup" correctly resolves the class and its nested types with the full namespace:

"kind": "class", "qualifiedName": "simulator::ManifestStartup"
"kind": "struct", "qualifiedName": "simulator::ManifestStartup::Input"
"kind": "struct", "qualifiedName": "simulator::ManifestStartup::Output"
But the out-of-line method definition is indexed without the outer namespace:

"kind": "method", "qualifiedName": "ManifestStartup::Apply"
(missing the simulator:: prefix that the class and nested structs both have).

As a result:

codegraph callers "ManifestStartup::Apply" --json → {"callers": []}
codegraph impact "simulator/core/src/manifest_startup.cpp" --json → edgeCount: 0
codegraph callers "Apply" --json --limit 200 (unqualified, broad) → the real caller file never appears in the result set at all
despite the call site being real and unambiguous (confirmed via plain grep).

Expected
The out-of-line method definition's qualifiedName should carry the same namespace prefix as the class/nested-type symbols it belongs to (simulator::ManifestStartup::Apply), and the call-site resolution added in v1.3.0 for ns::fn(...) should link through consistently for this pattern too.

Context
Found while validating a mechanical cross-check that compares an architecture-model declaration ("component A calls component B") against codegraph's real call graph. The broad namespace-qualified-call fix in v1.3.0 works correctly for plain free functions in a namespace; this narrower case (nested namespace + out-of-line static method definition, called via the fully-qualified path from another file) still doesn't link.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions