| ... | @@ -976,11 +976,23 @@ static AstNode *trans_type(Context *c, const Type *ty, const SourceLocation &sou | ... | @@ -976,11 +976,23 @@ static AstNode *trans_type(Context *c, const Type *ty, const SourceLocation &sou |
| 976 | const AttributedType *attributed_ty = static_cast<const AttributedType *>(ty); | 976 | const AttributedType *attributed_ty = static_cast<const AttributedType *>(ty); |
| 977 | return trans_qual_type(c, attributed_ty->getEquivalentType(), source_loc); | 977 | return trans_qual_type(c, attributed_ty->getEquivalentType(), source_loc); |
| 978 | } | 978 | } |
| | 979 | case Type::IncompleteArray: |
| | 980 | { |
| | 981 | const IncompleteArrayType *incomplete_array_ty = static_cast<const IncompleteArrayType *>(ty); |
| | 982 | QualType child_qt = incomplete_array_ty->getElementType(); |
| | 983 | AstNode *child_type_node = trans_qual_type(c, child_qt, source_loc); |
| | 984 | if (child_type_node == nullptr) { |
| | 985 | emit_warning(c, source_loc, "unresolved array element type"); |
| | 986 | return nullptr; |
| | 987 | } |
| | 988 | AstNode *pointer_node = trans_create_node_addr_of(c, child_qt.isConstQualified(), |
| | 989 | child_qt.isVolatileQualified(), child_type_node); |
| | 990 | return pointer_node; |
| | 991 | } |
| 979 | case Type::BlockPointer: | 992 | case Type::BlockPointer: |
| 980 | case Type::LValueReference: | 993 | case Type::LValueReference: |
| 981 | case Type::RValueReference: | 994 | case Type::RValueReference: |
| 982 | case Type::MemberPointer: | 995 | case Type::MemberPointer: |
| 983 | case Type::IncompleteArray: | | |
| 984 | case Type::VariableArray: | 996 | case Type::VariableArray: |
| 985 | case Type::DependentSizedArray: | 997 | case Type::DependentSizedArray: |
| 986 | case Type::DependentSizedExtVector: | 998 | case Type::DependentSizedExtVector: |
| ... | @@ -4301,7 +4313,7 @@ int parse_h_file(ImportTableEntry *import, ZigList<ErrorMsg *> *errors, const ch | ... | @@ -4301,7 +4313,7 @@ int parse_h_file(ImportTableEntry *import, ZigList<ErrorMsg *> *errors, const ch |
| 4301 | } | 4313 | } |
| 4302 | } | 4314 | } |
| 4303 | | 4315 | |
| 4304 | return 0; | 4316 | return ErrorUnexpected; |
| 4305 | } | 4317 | } |
| 4306 | | 4318 | |
| 4307 | c->ctx = &ast_unit->getASTContext(); | 4319 | c->ctx = &ast_unit->getASTContext(); |