Skip to content

c/cpp: MSVC COM interface keyword misparsed as function instead of struct #1519

Description

@timxx

Description

MSVC COM headers use #define interface struct to alias the COM interface keyword. When tree-sitter-cpp encounters a definition like:

interface IMyComInterface : IParentInterface {
    virtual void Foo() = 0;
    virtual void Bar() = 0;
};

The parser reads interface as the declaration's return type and IMyComInterface as the declarator — the whole class vanishes from the graph and IMyComInterface surfaces as a phantom function node instead of a struct:

codegraph query IMyComInterface
→ function    IMyComInterface
  include/sdk/com/MyInterface.h:42

We'd expected IMyComInterface is a struct kind

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