Currently, looking up the offset of a field in a type with an incomplete array, using clang_Type_getOffsetOf always returns CXTypeLayoutError_Incomplete. e.g. for the following:
struct Foo { int size; void* data[]; // incomplete array };
This returns CXTypeLayoutError_Incomplete when looking up the offset of either the 'size' or the 'data' field.
But, since an incomplete array always appears at the end of a record, looking up the field offsets should be fine. Note that this also works fine using the offsetof macro.
The fix for this is to ignore incomplete array fields when doing the recursive type validation.
Can you run this through clang-format so it matches our usual formatting style rules?