Rudimentary support for some constant struct #raw_union

This commit is contained in:
gingerBill
2025-09-29 10:28:16 +01:00
parent 1f2cedcf78
commit 10ba956d6a
3 changed files with 50 additions and 3 deletions

View File

@@ -9847,7 +9847,7 @@ gb_internal ExprKind check_compound_literal(CheckerContext *c, Operand *o, Ast *
if (t->Struct.is_raw_union) {
if (cl->elems.count > 0) {
// NOTE: unions cannot be constant
is_constant = false;
is_constant = elem_type_can_be_constant(t);
if (cl->elems[0]->kind != Ast_FieldValue) {
gbString type_str = type_to_string(type);