Skip to content

cpp func_start misses conversion operators with template/generic return types #2010

Closed

Description

@squid-protocol

Summary

gitgalaxy/standards/language_standards.py's cpp func_start regex includes an operator-name alternation branch with this generic-identifier segment:

(?:[a-zA-Z_]\w*::)*operator[ \t]+(?:::)?[a-zA-Z_]\w*(?:::[a-zA-Z_]\w*)*(?:[ \t]*[*&]+)?

This only supports a plain identifier or ::-qualified identifier chain as the conversion operator's target type — it has no support for a template/generic return type with angle brackets, e.g. operator Vector<T>().

Confirmed instance

language-crucible/data/cpp/godot/variant.cpp:2219:

Variant::operator Vector<::RID>() const {

Direct regex testing (isolated snippet, no surrounding context needed to reproduce) confirms zero matches. Both tree-sitter and ctags correctly find this as a real function (tree-sitter names it Variant::operator Vector<::RID>() const, ctags names it Variant::operator Vector<::RID>); GitGalaxy's DB has nothing at that line.

Additional instances in the same corpus

The same file has several more instances of this exact pattern:

  • operator Vector<Plane>()
  • operator Vector<Face3>()
  • operator Vector<Variant>()
  • operator Vector<StringName>()

language-crucible/data/cpp/godot/variant.h has:

  • operator TypedArray<T>()
  • operator BitField<T>()
  • operator TypedDictionary<K,V>()

All are likely missed by the same regex branch.

Impact

Conversion operators with template return types vanish completely from extraction results, producing false-negative func_start entries and degrading type-conversion dependency tracing.

Suggested fix direction

Extend the operator-name branch to accept a template argument list (balanced <...>, reusing the same bounded-angle-bracket-generic pattern the rest of this regex already uses elsewhere for other purposes, e.g. its own template-parameter-list prefix). Needs the same full Differential Scan verification chain as Issue #2009 before shipping — production regex change, real blast radius.

Activity

  1. added
    bug
    testing
    core-engine
    threat: false-negative
    on Aug 21, 2026
  2. added a commit that references this issue on Aug 26, 2026
    21d574b
  3. added this to the v2.4.9 milestone on Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcore-enginepriority: mediumtestingthreat: false-negative

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions