Using -> to dereference a struct is incorrectly complaining that it is 
being applied to a declared but not defined struct, when the struct in 
question is first forward declared:

test.ispc:21:5: Error: Member operator 
        "->" can't be applied to 
        declared but not defined struct 
        type "uniform struct A". 
    b.mA->mX = 3;
    ^^^^^^^^

This is using ispc-1.9.2.  Is this a known issue?  Am I incorrectly 
thinking that this should work?  The example below may look a little 
contrived, in practice we are hitting this issue when the forward 
declaration takes place in header files and the definition is only brought 
into the needed compilation units.

Cheers,
-Brian

----- test.ispc

// forward declaration of A
struct A;

struct B
{
    uniform A * uniform mA;
};

// definition of A
struct A
{
    int mX;
};


export void
run()
{
    B b;
    // BUG:  this does not compile ???
    b.mA->mX = 3;

    // but this is fine
    // uniform A * uniform a2 = b.mA;
    // a2->mX = 3;
}

-- 
You received this message because you are subscribed to the Google Groups 
"Intel SPMD Program Compiler Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ispc-users/6a1365c5-9aa1-4759-9364-0b7544eef5ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to