UTBotCpp icon indicating copy to clipboard operation
UTBotCpp copied to clipboard

Nested structs as function parameters are not supported

Open IDKWNTCMF opened this issue 2 years ago • 0 comments

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 = {

IDKWNTCMF avatar Aug 31 '23 12:08 IDKWNTCMF