Skip to content

Nested structs as function parameters are not supported #630

Open
@IDKWNTCMF

Description

@IDKWNTCMF

Description
In C we can use nested structs as function parameters without parent struct typename. But wrappers for such functions cannot be compiled with C++ compilers

Example

struct MainStruct {
    struct InnerStruct {
        int fld;
    } str;
};

int get_fld(struct InnerStruct *str) {
    return str->fld;
}

To Reproduce
Steps to reproduce the behavior:

  1. Copy the example above to your project
  2. Generate tests for function get_fld
  3. Try to run generated tests

Expected behavior
Tests are supposed to be executed successfully.

Actual behavior
Compilation error.

Visual proofs (screenshots, logs)

error: variable has incomplete type 'struct InnerStruct'
    struct InnerStruct expected_str = {

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions