The following reduced C code from sqlite fails to compile:
typedef struct RowSet RowSet;
struct RowSetChunk {
struct RowSetChunk *pNextChunk;
};
struct RowSet {
struct RowSetChunk *pChunk;
};
void foo(struct RowSet *pRowSet){
struct RowSetChunk **ppPrevTree = &pRowSet->pChunk; // Error: forward reference to `(*pRowSet).pChunk`
}
Oddly, if you remove the typedef it compiles without error, even though the typedef is not used at all. If you move the typedef, it also compiles without error.