| ... | @@ -840,8 +840,23 @@ static bool type_is_opaque(Context *c, const ZigClangType *ty, ZigClangSourceLoc | ... | @@ -840,8 +840,23 @@ static bool type_is_opaque(Context *c, const ZigClangType *ty, ZigClangSourceLoc |
| 840 | return ZigClangBuiltinType_getKind(builtin_ty) == ZigClangBuiltinTypeVoid; | 840 | return ZigClangBuiltinType_getKind(builtin_ty) == ZigClangBuiltinTypeVoid; |
| 841 | } | 841 | } |
| 842 | case ZigClangType_Record: { | 842 | case ZigClangType_Record: { |
| 843 | const clang::RecordType *record_ty = reinterpret_cast<const clang::RecordType*>(ty); | 843 | const ZigClangRecordType *record_ty = reinterpret_cast<const ZigClangRecordType*>(ty); |
| 844 | return record_ty->getDecl()->getDefinition() == nullptr; | 844 | const ZigClangRecordDecl *record_decl = ZigClangRecordType_getDecl(record_ty); |
| | 845 | const ZigClangRecordDecl *record_def = ZigClangRecordDecl_getDefinition(record_decl); |
| | 846 | if (record_def == nullptr) { |
| | 847 | return true; |
| | 848 | } |
| | 849 | for (auto it = reinterpret_cast<const clang::RecordDecl *>(record_def)->field_begin(), |
| | 850 | it_end = reinterpret_cast<const clang::RecordDecl *>(record_def)->field_end(); |
| | 851 | it != it_end; ++it) |
| | 852 | { |
| | 853 | const clang::FieldDecl *field_decl = *it; |
| | 854 | |
| | 855 | if (field_decl->isBitField()) { |
| | 856 | return true; |
| | 857 | } |
| | 858 | } |
| | 859 | return false; |
| 845 | } | 860 | } |
| 846 | case ZigClangType_Elaborated: { | 861 | case ZigClangType_Elaborated: { |
| 847 | const clang::ElaboratedType *elaborated_ty = reinterpret_cast<const clang::ElaboratedType*>(ty); | 862 | const clang::ElaboratedType *elaborated_ty = reinterpret_cast<const clang::ElaboratedType*>(ty); |