Known Issues and Fixes in C++ Collector
mainThis document tracks historical issues encountered during the parsing of C++ code (specifically within freq_service v7) using the ABCoder C++ Collector. It details phenomena, root causes, and the status of fixes for issues related to template functions, NVI (Non-Virtual Interface) patterns, inheritance, and forward declarations.
Key Areas of Improvement
- Template Function Calls: Fixed issues where template function calls (e.g.,
main<...>(...)) were not being correctly identified as reference tokens, leading to failed dependency collection. - Inheritance and Templates: Resolved bugs where
Implementsfields were empty for classes inheriting from template base classes (e.g.,SimpleProvider<X,Y>). The collector now usesBaseClassRefsto parse base names directly fromdeclarationTextwhen standard definition lookups fail. - NVI and Method Ownership: Fixed issues where methods using the NVI pattern or inline-in-class definitions had missing dependencies or incorrect
NodeIDassignments. The collector now correctly distinguishes between inline methods (where the receiver class body contains the method body) and out-of-line methods to avoid skipping dependency tokens. - Forward Declarations: Fixed a bug where forward declarations (e.g.,
class X;) were incorrectly emitted as fullTypenodes. The collector now filters these out by checking if the content contains a{brace. - Alias Resolution: Improved support for
using NS::Name;declarations to prevent incorrectNodeIDconstruction (e.g., preventingapp::Provider::Providererrors) by implementingresolveAliasand better alias detection inspec.go.