Skip to content

cpp/c: func_start misses a function whose return type is a macro (STDAPI, IFACEMETHODIMP) #2460

Closed

Description

@squid-protocol

Summary

GitGalaxy's C/C++ func_start does not match a function definition whose return type is supplied
by a macro and/or preceded by a macro annotation — the Win32/COM idiom.

Repro

language-crucible/data/cpp/powertoys/ImageResizerExt.cpp:6:

__control_entrypoint(DllExport) STDAPI DllCanUnloadNow()
{
    return _AtlModule.DllCanUnloadNow();
}

STDAPI expands to EXTERN_C HRESULT STDAPICALLTYPE; __control_entrypoint(DllExport) is a SAL
annotation macro. GitGalaxy emits nothing for DllCanUnloadNow; tree-sitter-cpp finds it (the
last real recall gap in the cpp corpus after the 2026-08-29 recall audit — cpp func recall
99.9%, one miss).

Related, same mechanism, other side of the corpus: powertoys/FancyZones.cpp's
IFACEMETHODIMP_(HRESULT, HandleWinHookEvent)(...) — a macro that is the whole declarator
shape.

Fix direction

Allow an all-caps IDENTIFIER (optionally IDENTIFIER(...) for an annotation macro) in the
return-type-prefix position of the C/C++ func_start regex, the same way the existing
_FORCE_INLINE_ / static / inline prefixes are tolerated. Keep it bounded (a single
all-caps token, not a run) so it can't run away.

Found by

tri-comparison-ledger-sweep step 2.6 recall audit, 2026-08-29.

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-engine

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions