Skip to content

Feature Request: Distinguish Empty Struct Definition from Forward Declaration #526

Description

@luoliwoshang

Current Problem:
The current implementation in inComplete() function (type.go:336-338) incorrectly treats empty struct definitions and forward declarations as the same thing by only checking if the fields list is empty:

https://github.com/goplus/llcppg/blob/5c906680a5817e206ebf77640f05d0505a6a1aa5/cl/internal/convert/type.go#L332-L338

This causes both cases to be treated as incomplete types:

  • Empty struct definition: struct A {}
  • Forward declaration: struct A;
    Impact:
  • Empty structs are incorrectly marked as forward declarations
  • Type completeness detection is inaccurate
  • May affect code generation and type checking

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions