Browse Source

Allow single field struct #raw_union

gingerBill 6 years ago
parent
commit
a3e6e8d304
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/check_type.cpp

+ 1 - 1
src/check_type.cpp

@@ -333,7 +333,7 @@ void check_struct_type(CheckerContext *ctx, Type *struct_type, Ast *node, Array<
 
 
 	scope_reserve(ctx->scope, min_field_count);
 	scope_reserve(ctx->scope, min_field_count);
 
 
-	if (st->is_raw_union) {
+	if (st->is_raw_union && min_field_count > 1) {
 		struct_type->Struct.is_raw_union = true;
 		struct_type->Struct.is_raw_union = true;
 		context = str_lit("struct #raw_union");
 		context = str_lit("struct #raw_union");
 	}
 	}