What happens
In a large C++/Unreal-Engine codebase, codegraph_explore for a heavily used
class (e.g. APXCharacter) returns mostly forward-declaration sites and even
picks one as the blast-radius representative, while the real definition (with
members and callers) is crowded out.
Root cause
A class Foo; forward declaration parses as a bodiless class_specifier.
extractStruct (#831) and extractEnum skip their bodiless forms, but
extractClass does not — so every forward decl (repeated across dozens of
headers) mints a phantom bodiless class node that competes with the single
real definition.
Expected
Bodiless class specifiers in C/C++ should be skipped, exactly like bodiless
structs/enums, so only the real definition is indexed. Languages where a
bodiless class is a complete definition (Kotlin class Empty, Scala) must be
unaffected.
Repro
Index any C++ project where a class is forward-declared in many headers, then
codegraph_explore that class name — the results are dominated by
class Foo; sites instead of the definition.
What happens
In a large C++/Unreal-Engine codebase,
codegraph_explorefor a heavily usedclass (e.g.
APXCharacter) returns mostly forward-declaration sites and evenpicks one as the blast-radius representative, while the real definition (with
members and callers) is crowded out.
Root cause
A
class Foo;forward declaration parses as a bodilessclass_specifier.extractStruct(#831) andextractEnumskip their bodiless forms, butextractClassdoes not — so every forward decl (repeated across dozens ofheaders) mints a phantom bodiless
classnode that competes with the singlereal definition.
Expected
Bodiless class specifiers in C/C++ should be skipped, exactly like bodiless
structs/enums, so only the real definition is indexed. Languages where a
bodiless class is a complete definition (Kotlin
class Empty, Scala) must beunaffected.
Repro
Index any C++ project where a class is forward-declared in many headers, then
codegraph_explorethat class name — the results are dominated byclass Foo;sites instead of the definition.