diff options
| author | gingerBill <bill@gingerbill.org> | 2019-11-21 20:05:45 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-11-21 20:05:45 +0000 |
| commit | 45d844f9d2f3791bd4dd06724d6835a6a6ebd2c4 (patch) | |
| tree | 67b80dc8b86b0de7be71f8526b7049d52ba5a1e4 /src | |
| parent | 9b58781122aaed23f3952eff6ba749e62a04a2ae (diff) | |
Disable #soa compound literals
Diffstat (limited to 'src')
| -rw-r--r-- | src/check_expr.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index c8c1cdc23..bb95f875e 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -7194,6 +7194,28 @@ ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast *node, Type type = alloc_type_array(check_type(c, cl->type->ArrayType.elem), -1); is_to_be_determined_array_count = true; } + if (cl->elems.count > 0) { + if (cl->type->ArrayType.tag != nullptr) { + Ast *tag = cl->type->ArrayType.tag; + GB_ASSERT(tag->kind == Ast_BasicDirective); + String name = tag->BasicDirective.name; + if (name == "soa") { + error(node, "#soa arrays are not supported for compound literals"); + return kind; + } + } + } + } + if (cl->type->kind == Ast_DynamicArrayType && cl->type->DynamicArrayType.tag != nullptr) { + if (cl->elems.count > 0) { + Ast *tag = cl->type->DynamicArrayType.tag; + GB_ASSERT(tag->kind == Ast_BasicDirective); + String name = tag->BasicDirective.name; + if (name == "soa") { + error(node, "#soa arrays are not supported for compound literals"); + return kind; + } + } } if (type == nullptr) { |